From d7c4b2ed387c3db1c67f7ca71f91e38d9d17a98d Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 10 Apr 2020 15:43:26 -0700 Subject: [PATCH 01/26] LRO Continuation Token --- .../codegen/templates/lro_operation.py.jinja2 | 27 +- .../_lr_os_custom_header_operations_async.py | 92 +- .../_lro_retrys_operations_async.py | 155 +++- .../_lros_operations_async.py | 865 +++++++++++++----- .../_lrosads_operations_async.py | 582 +++++++++--- .../_lr_os_custom_header_operations.py | 92 +- .../lro/operations/_lro_retrys_operations.py | 155 +++- .../Lro/lro/operations/_lros_operations.py | 865 +++++++++++++----- .../Lro/lro/operations/_lrosads_operations.py | 582 +++++++++--- test/azure/requirements.txt | 4 +- 10 files changed, 2551 insertions(+), 868 deletions(-) diff --git a/autorest/codegen/templates/lro_operation.py.jinja2 b/autorest/codegen/templates/lro_operation.py.jinja2 index 34ffbaf893d..51bc01d4207 100644 --- a/autorest/codegen/templates/lro_operation.py.jinja2 +++ b/autorest/codegen/templates/lro_operation.py.jinja2 @@ -43,6 +43,7 @@ response_headers = { :type {{ parameter.serialized_name }}: {{ parameter.schema.docstring_type }} {% endfor %} :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.{{ "Async" if async_mode else "" }}PollingMethod @@ -51,13 +52,15 @@ response_headers = { """ polling = kwargs.pop('polling', {{ "True" if code_model.options['azure_arm'] else "False" }}) # type: Union[bool, {{ "Async" if async_mode else "" }}PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[{{ keywords.return_type_annotation(operation) }}] - raw_result = {{ keywords.await }}self._{{ operation.name }}_initial( - {% for parameter in operation.parameters.method %} - {{ parameter.serialized_name }}={{ parameter.serialized_name }}, - {% endfor %} - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = {{ keywords.await }}self._{{ operation.name }}_initial( + {% for parameter in operation.parameters.method %} + {{ parameter.serialized_name }}={{ parameter.serialized_name }}, + {% endfor %} + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): {% if operation.lro_response.has_headers %} @@ -84,5 +87,13 @@ response_headers = { {% endif %} elif polling is False: polling_method = {{ async_prefix }}NoPolling() else: polling_method = polling - return {{ keywords.await }}{{ poller }}(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return {{ keywords.await }}{{ poller }}.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return {{ keywords.await }}{{ poller }}(self._client, raw_result, get_long_running_output, polling_method) {{ operation_name }}.metadata = {'url': '{{ operation.url }}'} \ No newline at end of file diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py index 52acb898e6d..38e10e1e9dd 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py @@ -102,6 +102,7 @@ async def put_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -112,11 +113,13 @@ async def put_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_async_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_async_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -137,7 +140,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_async_retry_succeeded.metadata = {'url': '/lro/customheader/putasync/retry/succeeded'} async def _put201_creating_succeeded200_initial( @@ -200,6 +211,7 @@ async def put201_creating_succeeded200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -210,11 +222,13 @@ async def put201_creating_succeeded200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put201_creating_succeeded200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put201_creating_succeeded200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -230,7 +244,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put201_creating_succeeded200.metadata = {'url': '/lro/customheader/put/201/creating/succeeded/200'} async def _post202_retry200_initial( @@ -288,6 +310,7 @@ async def post202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -298,11 +321,13 @@ async def post202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._post202_retry200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post202_retry200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -315,7 +340,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post202_retry200.metadata = {'url': '/lro/customheader/post/202/retry/200'} async def _post_async_retry_succeeded_initial( @@ -374,6 +407,7 @@ async def post_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -384,11 +418,13 @@ async def post_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._post_async_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_async_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -401,5 +437,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post_async_retry_succeeded.metadata = {'url': '/lro/customheader/postasync/retry/succeeded'} diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py index ae8cbe6a9c4..41e9450701b 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py @@ -103,6 +103,7 @@ async def put201_creating_succeeded200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -113,11 +114,13 @@ async def put201_creating_succeeded200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put201_creating_succeeded200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put201_creating_succeeded200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -133,7 +136,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put201_creating_succeeded200.metadata = {'url': '/lro/retryerror/put/201/creating/succeeded/200'} async def _put_async_relative_retry_succeeded_initial( @@ -195,6 +206,7 @@ async def put_async_relative_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -205,11 +217,13 @@ async def put_async_relative_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_async_relative_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_async_relative_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -230,7 +244,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/putasync/retry/succeeded'} async def _delete_provisioning202_accepted200_succeeded_initial( @@ -283,6 +305,7 @@ async def delete_provisioning202_accepted200_succeeded( """Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -293,10 +316,12 @@ async def delete_provisioning202_accepted200_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._delete_provisioning202_accepted200_succeeded_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_provisioning202_accepted200_succeeded_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -316,7 +341,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/retryerror/delete/provisioning/202/accepted/200/succeeded'} async def _delete202_retry200_initial( @@ -361,6 +394,7 @@ async def delete202_retry200( """Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -371,10 +405,12 @@ async def delete202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete202_retry200_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete202_retry200_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -387,7 +423,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete202_retry200.metadata = {'url': '/lro/retryerror/delete/202/retry/200'} async def _delete_async_relative_retry_succeeded_initial( @@ -433,6 +477,7 @@ async def delete_async_relative_retry_succeeded( """Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -443,10 +488,12 @@ async def delete_async_relative_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete_async_relative_retry_succeeded_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_async_relative_retry_succeeded_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -459,7 +506,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/deleteasync/retry/succeeded'} async def _post202_retry200_initial( @@ -517,6 +572,7 @@ async def post202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -527,11 +583,13 @@ async def post202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._post202_retry200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post202_retry200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -544,7 +602,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post202_retry200.metadata = {'url': '/lro/retryerror/post/202/retry/200'} async def _post_async_relative_retry_succeeded_initial( @@ -603,6 +669,7 @@ async def post_async_relative_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -613,11 +680,13 @@ async def post_async_relative_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._post_async_relative_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_async_relative_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -630,5 +699,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/postasync/retry/succeeded'} diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py index 4aedc4a321e..65c748bfdf9 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py @@ -100,6 +100,7 @@ async def put200_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -110,11 +111,13 @@ async def put200_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put200_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put200_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -130,7 +133,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put200_succeeded.metadata = {'url': '/lro/put/200/succeeded'} async def _put200_succeeded_no_state_initial( @@ -188,6 +199,7 @@ async def put200_succeeded_no_state( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -198,11 +210,13 @@ async def put200_succeeded_no_state( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put200_succeeded_no_state_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put200_succeeded_no_state_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -218,7 +232,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put200_succeeded_no_state.metadata = {'url': '/lro/put/200/succeeded/nostate'} async def _put202_retry200_initial( @@ -276,6 +298,7 @@ async def put202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -286,11 +309,13 @@ async def put202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put202_retry200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put202_retry200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -306,7 +331,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put202_retry200.metadata = {'url': '/lro/put/202/retry/200'} async def _put201_creating_succeeded200_initial( @@ -369,6 +402,7 @@ async def put201_creating_succeeded200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -379,11 +413,13 @@ async def put201_creating_succeeded200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put201_creating_succeeded200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put201_creating_succeeded200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -399,7 +435,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put201_creating_succeeded200.metadata = {'url': '/lro/put/201/creating/succeeded/200'} async def _put200_updating_succeeded204_initial( @@ -457,6 +501,7 @@ async def put200_updating_succeeded204( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -467,11 +512,13 @@ async def put200_updating_succeeded204( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put200_updating_succeeded204_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put200_updating_succeeded204_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -487,7 +534,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put200_updating_succeeded204.metadata = {'url': '/lro/put/200/updating/succeeded/200'} async def _put201_creating_failed200_initial( @@ -550,6 +605,7 @@ async def put201_creating_failed200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -560,11 +616,13 @@ async def put201_creating_failed200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put201_creating_failed200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put201_creating_failed200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -580,7 +638,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put201_creating_failed200.metadata = {'url': '/lro/put/201/created/failed/200'} async def _put200_acceptedcanceled200_initial( @@ -638,6 +704,7 @@ async def put200_acceptedcanceled200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -648,11 +715,13 @@ async def put200_acceptedcanceled200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put200_acceptedcanceled200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put200_acceptedcanceled200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -668,7 +737,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put200_acceptedcanceled200.metadata = {'url': '/lro/put/200/accepted/canceled/200'} async def _put_no_header_in_retry_initial( @@ -728,6 +805,7 @@ async def put_no_header_in_retry( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -738,11 +816,13 @@ async def put_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_no_header_in_retry_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_no_header_in_retry_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -761,7 +841,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_no_header_in_retry.metadata = {'url': '/lro/put/noheader/202/200'} async def _put_async_retry_succeeded_initial( @@ -823,6 +911,7 @@ async def put_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -833,11 +922,13 @@ async def put_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_async_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_async_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -858,7 +949,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_async_retry_succeeded.metadata = {'url': '/lro/putasync/retry/succeeded'} async def _put_async_no_retry_succeeded_initial( @@ -919,6 +1018,7 @@ async def put_async_no_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -929,11 +1029,13 @@ async def put_async_no_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_async_no_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_async_no_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -953,7 +1055,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_async_no_retry_succeeded.metadata = {'url': '/lro/putasync/noretry/succeeded'} async def _put_async_retry_failed_initial( @@ -1015,6 +1125,7 @@ async def put_async_retry_failed( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1025,11 +1136,13 @@ async def put_async_retry_failed( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_async_retry_failed_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_async_retry_failed_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1050,7 +1163,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_async_retry_failed.metadata = {'url': '/lro/putasync/retry/failed'} async def _put_async_no_retrycanceled_initial( @@ -1111,6 +1232,7 @@ async def put_async_no_retrycanceled( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1121,11 +1243,13 @@ async def put_async_no_retrycanceled( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_async_no_retrycanceled_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_async_no_retrycanceled_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1145,7 +1269,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_async_no_retrycanceled.metadata = {'url': '/lro/putasync/noretry/canceled'} async def _put_async_no_header_in_retry_initial( @@ -1205,6 +1337,7 @@ async def put_async_no_header_in_retry( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1215,11 +1348,13 @@ async def put_async_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_async_no_header_in_retry_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_async_no_header_in_retry_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1238,7 +1373,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_async_no_header_in_retry.metadata = {'url': '/lro/putasync/noheader/201/200'} async def _put_non_resource_initial( @@ -1296,6 +1439,7 @@ async def put_non_resource( :param sku: sku to put. :type sku: ~lro.models.Sku :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1306,11 +1450,13 @@ async def put_non_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] - raw_result = await self._put_non_resource_initial( - sku=sku, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_non_resource_initial( + sku=sku, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Sku', pipeline_response) @@ -1326,7 +1472,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_non_resource.metadata = {'url': '/lro/putnonresource/202/200'} async def _put_async_non_resource_initial( @@ -1384,6 +1538,7 @@ async def put_async_non_resource( :param sku: Sku to put. :type sku: ~lro.models.Sku :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1394,11 +1549,13 @@ async def put_async_non_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] - raw_result = await self._put_async_non_resource_initial( - sku=sku, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_async_non_resource_initial( + sku=sku, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Sku', pipeline_response) @@ -1414,7 +1571,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_async_non_resource.metadata = {'url': '/lro/putnonresourceasync/202/200'} async def _put_sub_resource_initial( @@ -1474,6 +1639,7 @@ async def put_sub_resource( :param provisioning_state: :type provisioning_state: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1484,11 +1650,13 @@ async def put_sub_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] - raw_result = await self._put_sub_resource_initial( - provisioning_state=provisioning_state, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_sub_resource_initial( + provisioning_state=provisioning_state, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('SubProduct', pipeline_response) @@ -1504,7 +1672,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_sub_resource.metadata = {'url': '/lro/putsubresource/202/200'} async def _put_async_sub_resource_initial( @@ -1564,6 +1740,7 @@ async def put_async_sub_resource( :param provisioning_state: :type provisioning_state: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1574,11 +1751,13 @@ async def put_async_sub_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] - raw_result = await self._put_async_sub_resource_initial( - provisioning_state=provisioning_state, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_async_sub_resource_initial( + provisioning_state=provisioning_state, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('SubProduct', pipeline_response) @@ -1594,7 +1773,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_async_sub_resource.metadata = {'url': '/lro/putsubresourceasync/202/200'} async def _delete_provisioning202_accepted200_succeeded_initial( @@ -1647,6 +1834,7 @@ async def delete_provisioning202_accepted200_succeeded( """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1657,10 +1845,12 @@ async def delete_provisioning202_accepted200_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._delete_provisioning202_accepted200_succeeded_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_provisioning202_accepted200_succeeded_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1680,7 +1870,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/delete/provisioning/202/accepted/200/succeeded'} async def _delete_provisioning202_deleting_failed200_initial( @@ -1733,6 +1931,7 @@ async def delete_provisioning202_deleting_failed200( """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1743,10 +1942,12 @@ async def delete_provisioning202_deleting_failed200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._delete_provisioning202_deleting_failed200_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_provisioning202_deleting_failed200_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1766,7 +1967,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_provisioning202_deleting_failed200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/failed'} async def _delete_provisioning202_deletingcanceled200_initial( @@ -1819,6 +2028,7 @@ async def delete_provisioning202_deletingcanceled200( """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1829,10 +2039,12 @@ async def delete_provisioning202_deletingcanceled200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._delete_provisioning202_deletingcanceled200_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_provisioning202_deletingcanceled200_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1852,7 +2064,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_provisioning202_deletingcanceled200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/canceled'} async def _delete204_succeeded_initial( @@ -1893,6 +2113,7 @@ async def delete204_succeeded( """Long running delete succeeds and returns right away. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1903,10 +2124,12 @@ async def delete204_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete204_succeeded_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete204_succeeded_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -1919,7 +2142,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete204_succeeded.metadata = {'url': '/lro/delete/204/succeeded'} async def _delete202_retry200_initial( @@ -1971,6 +2202,7 @@ async def delete202_retry200( """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1981,10 +2213,12 @@ async def delete202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._delete202_retry200_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete202_retry200_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -2000,7 +2234,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete202_retry200.metadata = {'url': '/lro/delete/202/retry/200'} async def _delete202_no_retry204_initial( @@ -2052,6 +2294,7 @@ async def delete202_no_retry204( """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2062,10 +2305,12 @@ async def delete202_no_retry204( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._delete202_no_retry204_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete202_no_retry204_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -2081,7 +2326,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete202_no_retry204.metadata = {'url': '/lro/delete/202/noretry/204'} async def _delete_no_header_in_retry_initial( @@ -2126,6 +2379,7 @@ async def delete_no_header_in_retry( """Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2136,10 +2390,12 @@ async def delete_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete_no_header_in_retry_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_no_header_in_retry_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2152,7 +2408,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_no_header_in_retry.metadata = {'url': '/lro/delete/noheader'} async def _delete_async_no_header_in_retry_initial( @@ -2197,6 +2461,7 @@ async def delete_async_no_header_in_retry( """Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2207,10 +2472,12 @@ async def delete_async_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete_async_no_header_in_retry_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_async_no_header_in_retry_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2223,7 +2490,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_async_no_header_in_retry.metadata = {'url': '/lro/deleteasync/noheader/202/204'} async def _delete_async_retry_succeeded_initial( @@ -2269,6 +2544,7 @@ async def delete_async_retry_succeeded( """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2279,10 +2555,12 @@ async def delete_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete_async_retry_succeeded_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_async_retry_succeeded_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2295,7 +2573,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_async_retry_succeeded.metadata = {'url': '/lro/deleteasync/retry/succeeded'} async def _delete_async_no_retry_succeeded_initial( @@ -2341,6 +2627,7 @@ async def delete_async_no_retry_succeeded( """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2351,10 +2638,12 @@ async def delete_async_no_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete_async_no_retry_succeeded_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_async_no_retry_succeeded_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2367,7 +2656,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_async_no_retry_succeeded.metadata = {'url': '/lro/deleteasync/noretry/succeeded'} async def _delete_async_retry_failed_initial( @@ -2413,6 +2710,7 @@ async def delete_async_retry_failed( """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2423,10 +2721,12 @@ async def delete_async_retry_failed( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete_async_retry_failed_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_async_retry_failed_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2439,7 +2739,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_async_retry_failed.metadata = {'url': '/lro/deleteasync/retry/failed'} async def _delete_async_retrycanceled_initial( @@ -2485,6 +2793,7 @@ async def delete_async_retrycanceled( """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2495,10 +2804,12 @@ async def delete_async_retrycanceled( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete_async_retrycanceled_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_async_retrycanceled_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2511,7 +2822,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_async_retrycanceled.metadata = {'url': '/lro/deleteasync/retry/canceled'} async def _post200_with_payload_initial( @@ -2561,6 +2880,7 @@ async def post200_with_payload( """Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2571,10 +2891,12 @@ async def post200_with_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] - raw_result = await self._post200_with_payload_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post200_with_payload_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Sku', pipeline_response) @@ -2590,7 +2912,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post200_with_payload.metadata = {'url': '/lro/post/payload/200'} async def _post202_retry200_initial( @@ -2648,6 +2978,7 @@ async def post202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2658,11 +2989,13 @@ async def post202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._post202_retry200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post202_retry200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2675,7 +3008,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post202_retry200.metadata = {'url': '/lro/post/202/retry/200'} async def _post202_no_retry204_initial( @@ -2736,6 +3077,7 @@ async def post202_no_retry204( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2746,11 +3088,13 @@ async def post202_no_retry204( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._post202_no_retry204_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post202_no_retry204_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -2770,7 +3114,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post202_no_retry204.metadata = {'url': '/lro/post/202/noretry/204'} async def _post_double_headers_final_location_get_initial( @@ -2815,6 +3167,7 @@ async def post_double_headers_final_location_get( """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should poll Location to get the final object. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2825,10 +3178,12 @@ async def post_double_headers_final_location_get( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._post_double_headers_final_location_get_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_double_headers_final_location_get_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -2844,7 +3199,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post_double_headers_final_location_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalLocationGet'} async def _post_double_headers_final_azure_header_get_initial( @@ -2889,6 +3252,7 @@ async def post_double_headers_final_azure_header_get( """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2899,10 +3263,12 @@ async def post_double_headers_final_azure_header_get( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._post_double_headers_final_azure_header_get_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_double_headers_final_azure_header_get_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -2918,7 +3284,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post_double_headers_final_azure_header_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGet'} async def _post_double_headers_final_azure_header_get_default_initial( @@ -2963,6 +3337,7 @@ async def post_double_headers_final_azure_header_get_default( """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object if you support initial Autorest behavior. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2973,10 +3348,12 @@ async def post_double_headers_final_azure_header_get_default( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._post_double_headers_final_azure_header_get_default_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_double_headers_final_azure_header_get_default_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -2992,7 +3369,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post_double_headers_final_azure_header_get_default.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGetDefault'} async def _post_async_retry_succeeded_initial( @@ -3058,6 +3443,7 @@ async def post_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -3068,11 +3454,13 @@ async def post_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._post_async_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_async_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -3088,7 +3476,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post_async_retry_succeeded.metadata = {'url': '/lro/postasync/retry/succeeded'} async def _post_async_no_retry_succeeded_initial( @@ -3154,6 +3550,7 @@ async def post_async_no_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -3164,11 +3561,13 @@ async def post_async_no_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._post_async_no_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_async_no_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -3184,7 +3583,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post_async_no_retry_succeeded.metadata = {'url': '/lro/postasync/noretry/succeeded'} async def _post_async_retry_failed_initial( @@ -3243,6 +3650,7 @@ async def post_async_retry_failed( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -3253,11 +3661,13 @@ async def post_async_retry_failed( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._post_async_retry_failed_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_async_retry_failed_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -3270,7 +3680,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post_async_retry_failed.metadata = {'url': '/lro/postasync/retry/failed'} async def _post_async_retrycanceled_initial( @@ -3329,6 +3747,7 @@ async def post_async_retrycanceled( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -3339,11 +3758,13 @@ async def post_async_retrycanceled( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._post_async_retrycanceled_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_async_retrycanceled_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -3356,5 +3777,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post_async_retrycanceled.metadata = {'url': '/lro/postasync/retry/canceled'} diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py index d6e8bdaf8e6..8d5fc896ac9 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py @@ -103,6 +103,7 @@ async def put_non_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -113,11 +114,13 @@ async def put_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_non_retry400_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_non_retry400_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -133,7 +136,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_non_retry400.metadata = {'url': '/lro/nonretryerror/put/400'} async def _put_non_retry201_creating400_initial( @@ -196,6 +207,7 @@ async def put_non_retry201_creating400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -206,11 +218,13 @@ async def put_non_retry201_creating400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_non_retry201_creating400_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_non_retry201_creating400_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -226,7 +240,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_non_retry201_creating400.metadata = {'url': '/lro/nonretryerror/put/201/creating/400'} async def _put_non_retry201_creating400_invalid_json_initial( @@ -289,6 +311,7 @@ async def put_non_retry201_creating400_invalid_json( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -299,11 +322,13 @@ async def put_non_retry201_creating400_invalid_json( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_non_retry201_creating400_invalid_json_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_non_retry201_creating400_invalid_json_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -319,7 +344,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_non_retry201_creating400_invalid_json.metadata = {'url': '/lro/nonretryerror/put/201/creating/400/invalidjson'} async def _put_async_relative_retry400_initial( @@ -381,6 +414,7 @@ async def put_async_relative_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -391,11 +425,13 @@ async def put_async_relative_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_async_relative_retry400_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_async_relative_retry400_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -416,7 +452,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/putasync/retry/400'} async def _delete_non_retry400_initial( @@ -461,6 +505,7 @@ async def delete_non_retry400( """Long running delete request, service returns a 400 with an error body. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -471,10 +516,12 @@ async def delete_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete_non_retry400_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_non_retry400_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -487,7 +534,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/400'} async def _delete202_non_retry400_initial( @@ -532,6 +587,7 @@ async def delete202_non_retry400( """Long running delete request, service returns a 202 with a location header. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -542,10 +598,12 @@ async def delete202_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete202_non_retry400_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete202_non_retry400_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -558,7 +616,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete202_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/202/retry/400'} async def _delete_async_relative_retry400_initial( @@ -604,6 +670,7 @@ async def delete_async_relative_retry400( """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -614,10 +681,12 @@ async def delete_async_relative_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete_async_relative_retry400_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_async_relative_retry400_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -630,7 +699,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/deleteasync/retry/400'} async def _post_non_retry400_initial( @@ -688,6 +765,7 @@ async def post_non_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -698,11 +776,13 @@ async def post_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._post_non_retry400_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_non_retry400_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -715,7 +795,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post_non_retry400.metadata = {'url': '/lro/nonretryerror/post/400'} async def _post202_non_retry400_initial( @@ -773,6 +861,7 @@ async def post202_non_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -783,11 +872,13 @@ async def post202_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._post202_non_retry400_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post202_non_retry400_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -800,7 +891,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post202_non_retry400.metadata = {'url': '/lro/nonretryerror/post/202/retry/400'} async def _post_async_relative_retry400_initial( @@ -859,6 +958,7 @@ async def post_async_relative_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -869,11 +969,13 @@ async def post_async_relative_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._post_async_relative_retry400_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_async_relative_retry400_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -886,7 +988,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/postasync/retry/400'} async def _put_error201_no_provisioning_state_payload_initial( @@ -949,6 +1059,7 @@ async def put_error201_no_provisioning_state_payload( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -959,11 +1070,13 @@ async def put_error201_no_provisioning_state_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_error201_no_provisioning_state_payload_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_error201_no_provisioning_state_payload_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -979,7 +1092,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_error201_no_provisioning_state_payload.metadata = {'url': '/lro/error/put/201/noprovisioningstatepayload'} async def _put_async_relative_retry_no_status_initial( @@ -1041,6 +1162,7 @@ async def put_async_relative_retry_no_status( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1051,11 +1173,13 @@ async def put_async_relative_retry_no_status( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_async_relative_retry_no_status_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_async_relative_retry_no_status_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1076,7 +1200,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_async_relative_retry_no_status.metadata = {'url': '/lro/error/putasync/retry/nostatus'} async def _put_async_relative_retry_no_status_payload_initial( @@ -1138,6 +1270,7 @@ async def put_async_relative_retry_no_status_payload( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1148,11 +1281,13 @@ async def put_async_relative_retry_no_status_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_async_relative_retry_no_status_payload_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_async_relative_retry_no_status_payload_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1173,7 +1308,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_async_relative_retry_no_status_payload.metadata = {'url': '/lro/error/putasync/retry/nostatuspayload'} async def _delete204_succeeded_initial( @@ -1214,6 +1357,7 @@ async def delete204_succeeded( """Long running delete request, service returns a 204 to the initial request, indicating success. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1224,10 +1368,12 @@ async def delete204_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete204_succeeded_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete204_succeeded_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -1240,7 +1386,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete204_succeeded.metadata = {'url': '/lro/error/delete/204/nolocation'} async def _delete_async_relative_retry_no_status_initial( @@ -1286,6 +1440,7 @@ async def delete_async_relative_retry_no_status( """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1296,10 +1451,12 @@ async def delete_async_relative_retry_no_status( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete_async_relative_retry_no_status_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_async_relative_retry_no_status_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -1312,7 +1469,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_async_relative_retry_no_status.metadata = {'url': '/lro/error/deleteasync/retry/nostatus'} async def _post202_no_location_initial( @@ -1370,6 +1535,7 @@ async def post202_no_location( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1380,11 +1546,13 @@ async def post202_no_location( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._post202_no_location_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post202_no_location_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -1397,7 +1565,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post202_no_location.metadata = {'url': '/lro/error/post/202/nolocation'} async def _post_async_relative_retry_no_payload_initial( @@ -1456,6 +1632,7 @@ async def post_async_relative_retry_no_payload( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1466,11 +1643,13 @@ async def post_async_relative_retry_no_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._post_async_relative_retry_no_payload_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_async_relative_retry_no_payload_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -1483,7 +1662,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post_async_relative_retry_no_payload.metadata = {'url': '/lro/error/postasync/retry/nopayload'} async def _put200_invalid_json_initial( @@ -1543,6 +1730,7 @@ async def put200_invalid_json( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1553,11 +1741,13 @@ async def put200_invalid_json( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put200_invalid_json_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put200_invalid_json_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -1573,7 +1763,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put200_invalid_json.metadata = {'url': '/lro/error/put/200/invalidjson'} async def _put_async_relative_retry_invalid_header_initial( @@ -1635,6 +1833,7 @@ async def put_async_relative_retry_invalid_header( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1645,11 +1844,13 @@ async def put_async_relative_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_async_relative_retry_invalid_header_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_async_relative_retry_invalid_header_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1670,7 +1871,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/putasync/retry/invalidheader'} async def _put_async_relative_retry_invalid_json_polling_initial( @@ -1732,6 +1941,7 @@ async def put_async_relative_retry_invalid_json_polling( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1742,11 +1952,13 @@ async def put_async_relative_retry_invalid_json_polling( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = await self._put_async_relative_retry_invalid_json_polling_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._put_async_relative_retry_invalid_json_polling_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1767,7 +1979,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) put_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/putasync/retry/invalidjsonpolling'} async def _delete202_retry_invalid_header_initial( @@ -1812,6 +2032,7 @@ async def delete202_retry_invalid_header( """Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1822,10 +2043,12 @@ async def delete202_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete202_retry_invalid_header_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete202_retry_invalid_header_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -1838,7 +2061,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete202_retry_invalid_header.metadata = {'url': '/lro/error/delete/202/retry/invalidheader'} async def _delete_async_relative_retry_invalid_header_initial( @@ -1884,6 +2115,7 @@ async def delete_async_relative_retry_invalid_header( """Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1894,10 +2126,12 @@ async def delete_async_relative_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete_async_relative_retry_invalid_header_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_async_relative_retry_invalid_header_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -1910,7 +2144,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/deleteasync/retry/invalidheader'} async def _delete_async_relative_retry_invalid_json_polling_initial( @@ -1956,6 +2198,7 @@ async def delete_async_relative_retry_invalid_json_polling( """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1966,10 +2209,12 @@ async def delete_async_relative_retry_invalid_json_polling( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._delete_async_relative_retry_invalid_json_polling_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_async_relative_retry_invalid_json_polling_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -1982,7 +2227,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) delete_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/deleteasync/retry/invalidjsonpolling'} async def _post202_retry_invalid_header_initial( @@ -2040,6 +2293,7 @@ async def post202_retry_invalid_header( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2050,11 +2304,13 @@ async def post202_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._post202_retry_invalid_header_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post202_retry_invalid_header_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2067,7 +2323,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post202_retry_invalid_header.metadata = {'url': '/lro/error/post/202/retry/invalidheader'} async def _post_async_relative_retry_invalid_header_initial( @@ -2126,6 +2390,7 @@ async def post_async_relative_retry_invalid_header( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2136,11 +2401,13 @@ async def post_async_relative_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._post_async_relative_retry_invalid_header_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_async_relative_retry_invalid_header_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2153,7 +2420,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/postasync/retry/invalidheader'} async def _post_async_relative_retry_invalid_json_polling_initial( @@ -2212,6 +2487,7 @@ async def post_async_relative_retry_invalid_json_polling( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2222,11 +2498,13 @@ async def post_async_relative_retry_invalid_json_polling( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = await self._post_async_relative_retry_invalid_json_polling_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._post_async_relative_retry_invalid_json_polling_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2239,5 +2517,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return await async_poller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return await async_poller(self._client, raw_result, get_long_running_output, polling_method) post_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/postasync/retry/invalidjsonpolling'} diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py index 6c268b54e23..02cfe9ca23e 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py @@ -108,6 +108,7 @@ def begin_put_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -118,11 +119,13 @@ def begin_put_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_async_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_async_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -143,7 +146,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_succeeded.metadata = {'url': '/lro/customheader/putasync/retry/succeeded'} def _put201_creating_succeeded200_initial( @@ -208,6 +219,7 @@ def begin_put201_creating_succeeded200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -218,11 +230,13 @@ def begin_put201_creating_succeeded200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put201_creating_succeeded200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put201_creating_succeeded200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -238,7 +252,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/customheader/put/201/creating/succeeded/200'} def _post202_retry200_initial( @@ -298,6 +320,7 @@ def begin_post202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -308,11 +331,13 @@ def begin_post202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._post202_retry200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post202_retry200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -325,7 +350,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/customheader/post/202/retry/200'} def _post_async_retry_succeeded_initial( @@ -386,6 +419,7 @@ def begin_post_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -396,11 +430,13 @@ def begin_post_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._post_async_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_async_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -413,5 +449,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_succeeded.metadata = {'url': '/lro/customheader/postasync/retry/succeeded'} diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py index da940e134bd..2d2a8b3b1eb 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py @@ -109,6 +109,7 @@ def begin_put201_creating_succeeded200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -119,11 +120,13 @@ def begin_put201_creating_succeeded200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put201_creating_succeeded200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put201_creating_succeeded200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -139,7 +142,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/retryerror/put/201/creating/succeeded/200'} def _put_async_relative_retry_succeeded_initial( @@ -203,6 +214,7 @@ def begin_put_async_relative_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -213,11 +225,13 @@ def begin_put_async_relative_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_async_relative_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_async_relative_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -238,7 +252,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/putasync/retry/succeeded'} def _delete_provisioning202_accepted200_succeeded_initial( @@ -293,6 +315,7 @@ def begin_delete_provisioning202_accepted200_succeeded( """Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -303,10 +326,12 @@ def begin_delete_provisioning202_accepted200_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._delete_provisioning202_accepted200_succeeded_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_provisioning202_accepted200_succeeded_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -326,7 +351,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/retryerror/delete/provisioning/202/accepted/200/succeeded'} def _delete202_retry200_initial( @@ -373,6 +406,7 @@ def begin_delete202_retry200( """Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -383,10 +417,12 @@ def begin_delete202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete202_retry200_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete202_retry200_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -399,7 +435,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry200.metadata = {'url': '/lro/retryerror/delete/202/retry/200'} def _delete_async_relative_retry_succeeded_initial( @@ -447,6 +491,7 @@ def begin_delete_async_relative_retry_succeeded( """Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -457,10 +502,12 @@ def begin_delete_async_relative_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete_async_relative_retry_succeeded_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_async_relative_retry_succeeded_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -473,7 +520,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/deleteasync/retry/succeeded'} def _post202_retry200_initial( @@ -533,6 +588,7 @@ def begin_post202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -543,11 +599,13 @@ def begin_post202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._post202_retry200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post202_retry200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -560,7 +618,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/retryerror/post/202/retry/200'} def _post_async_relative_retry_succeeded_initial( @@ -621,6 +687,7 @@ def begin_post_async_relative_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -631,11 +698,13 @@ def begin_post_async_relative_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._post_async_relative_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_async_relative_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -648,5 +717,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/postasync/retry/succeeded'} diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py index faafc909564..0adeddc79cb 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py @@ -106,6 +106,7 @@ def begin_put200_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -116,11 +117,13 @@ def begin_put200_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put200_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put200_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -136,7 +139,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_succeeded.metadata = {'url': '/lro/put/200/succeeded'} def _put200_succeeded_no_state_initial( @@ -196,6 +207,7 @@ def begin_put200_succeeded_no_state( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -206,11 +218,13 @@ def begin_put200_succeeded_no_state( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put200_succeeded_no_state_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put200_succeeded_no_state_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -226,7 +240,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_succeeded_no_state.metadata = {'url': '/lro/put/200/succeeded/nostate'} def _put202_retry200_initial( @@ -286,6 +308,7 @@ def begin_put202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -296,11 +319,13 @@ def begin_put202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put202_retry200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put202_retry200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -316,7 +341,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put202_retry200.metadata = {'url': '/lro/put/202/retry/200'} def _put201_creating_succeeded200_initial( @@ -381,6 +414,7 @@ def begin_put201_creating_succeeded200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -391,11 +425,13 @@ def begin_put201_creating_succeeded200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put201_creating_succeeded200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put201_creating_succeeded200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -411,7 +447,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/put/201/creating/succeeded/200'} def _put200_updating_succeeded204_initial( @@ -471,6 +515,7 @@ def begin_put200_updating_succeeded204( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -481,11 +526,13 @@ def begin_put200_updating_succeeded204( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put200_updating_succeeded204_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put200_updating_succeeded204_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -501,7 +548,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_updating_succeeded204.metadata = {'url': '/lro/put/200/updating/succeeded/200'} def _put201_creating_failed200_initial( @@ -566,6 +621,7 @@ def begin_put201_creating_failed200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -576,11 +632,13 @@ def begin_put201_creating_failed200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put201_creating_failed200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put201_creating_failed200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -596,7 +654,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_failed200.metadata = {'url': '/lro/put/201/created/failed/200'} def _put200_acceptedcanceled200_initial( @@ -656,6 +722,7 @@ def begin_put200_acceptedcanceled200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -666,11 +733,13 @@ def begin_put200_acceptedcanceled200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put200_acceptedcanceled200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put200_acceptedcanceled200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -686,7 +755,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_acceptedcanceled200.metadata = {'url': '/lro/put/200/accepted/canceled/200'} def _put_no_header_in_retry_initial( @@ -748,6 +825,7 @@ def begin_put_no_header_in_retry( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -758,11 +836,13 @@ def begin_put_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_no_header_in_retry_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_no_header_in_retry_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -781,7 +861,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_no_header_in_retry.metadata = {'url': '/lro/put/noheader/202/200'} def _put_async_retry_succeeded_initial( @@ -845,6 +933,7 @@ def begin_put_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -855,11 +944,13 @@ def begin_put_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_async_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_async_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -880,7 +971,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_succeeded.metadata = {'url': '/lro/putasync/retry/succeeded'} def _put_async_no_retry_succeeded_initial( @@ -943,6 +1042,7 @@ def begin_put_async_no_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -953,11 +1053,13 @@ def begin_put_async_no_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_async_no_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_async_no_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -977,7 +1079,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_retry_succeeded.metadata = {'url': '/lro/putasync/noretry/succeeded'} def _put_async_retry_failed_initial( @@ -1041,6 +1151,7 @@ def begin_put_async_retry_failed( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1051,11 +1162,13 @@ def begin_put_async_retry_failed( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_async_retry_failed_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_async_retry_failed_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1076,7 +1189,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_failed.metadata = {'url': '/lro/putasync/retry/failed'} def _put_async_no_retrycanceled_initial( @@ -1139,6 +1260,7 @@ def begin_put_async_no_retrycanceled( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1149,11 +1271,13 @@ def begin_put_async_no_retrycanceled( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_async_no_retrycanceled_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_async_no_retrycanceled_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1173,7 +1297,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_retrycanceled.metadata = {'url': '/lro/putasync/noretry/canceled'} def _put_async_no_header_in_retry_initial( @@ -1235,6 +1367,7 @@ def begin_put_async_no_header_in_retry( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1245,11 +1378,13 @@ def begin_put_async_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_async_no_header_in_retry_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_async_no_header_in_retry_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1268,7 +1403,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_header_in_retry.metadata = {'url': '/lro/putasync/noheader/201/200'} def _put_non_resource_initial( @@ -1328,6 +1471,7 @@ def begin_put_non_resource( :param sku: sku to put. :type sku: ~lro.models.Sku :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1338,11 +1482,13 @@ def begin_put_non_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] - raw_result = self._put_non_resource_initial( - sku=sku, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_non_resource_initial( + sku=sku, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Sku', pipeline_response) @@ -1358,7 +1504,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_resource.metadata = {'url': '/lro/putnonresource/202/200'} def _put_async_non_resource_initial( @@ -1418,6 +1572,7 @@ def begin_put_async_non_resource( :param sku: Sku to put. :type sku: ~lro.models.Sku :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1428,11 +1583,13 @@ def begin_put_async_non_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] - raw_result = self._put_async_non_resource_initial( - sku=sku, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_async_non_resource_initial( + sku=sku, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Sku', pipeline_response) @@ -1448,7 +1605,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_non_resource.metadata = {'url': '/lro/putnonresourceasync/202/200'} def _put_sub_resource_initial( @@ -1510,6 +1675,7 @@ def begin_put_sub_resource( :param provisioning_state: :type provisioning_state: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1520,11 +1686,13 @@ def begin_put_sub_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] - raw_result = self._put_sub_resource_initial( - provisioning_state=provisioning_state, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_sub_resource_initial( + provisioning_state=provisioning_state, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('SubProduct', pipeline_response) @@ -1540,7 +1708,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_sub_resource.metadata = {'url': '/lro/putsubresource/202/200'} def _put_async_sub_resource_initial( @@ -1602,6 +1778,7 @@ def begin_put_async_sub_resource( :param provisioning_state: :type provisioning_state: str :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1612,11 +1789,13 @@ def begin_put_async_sub_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] - raw_result = self._put_async_sub_resource_initial( - provisioning_state=provisioning_state, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_async_sub_resource_initial( + provisioning_state=provisioning_state, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('SubProduct', pipeline_response) @@ -1632,7 +1811,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_sub_resource.metadata = {'url': '/lro/putsubresourceasync/202/200'} def _delete_provisioning202_accepted200_succeeded_initial( @@ -1687,6 +1874,7 @@ def begin_delete_provisioning202_accepted200_succeeded( """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1697,10 +1885,12 @@ def begin_delete_provisioning202_accepted200_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._delete_provisioning202_accepted200_succeeded_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_provisioning202_accepted200_succeeded_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1720,7 +1910,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/delete/provisioning/202/accepted/200/succeeded'} def _delete_provisioning202_deleting_failed200_initial( @@ -1775,6 +1973,7 @@ def begin_delete_provisioning202_deleting_failed200( """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1785,10 +1984,12 @@ def begin_delete_provisioning202_deleting_failed200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._delete_provisioning202_deleting_failed200_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_provisioning202_deleting_failed200_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1808,7 +2009,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_deleting_failed200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/failed'} def _delete_provisioning202_deletingcanceled200_initial( @@ -1863,6 +2072,7 @@ def begin_delete_provisioning202_deletingcanceled200( """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1873,10 +2083,12 @@ def begin_delete_provisioning202_deletingcanceled200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._delete_provisioning202_deletingcanceled200_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_provisioning202_deletingcanceled200_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1896,7 +2108,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_deletingcanceled200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/canceled'} def _delete204_succeeded_initial( @@ -1939,6 +2159,7 @@ def begin_delete204_succeeded( """Long running delete succeeds and returns right away. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1949,10 +2170,12 @@ def begin_delete204_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete204_succeeded_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete204_succeeded_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -1965,7 +2188,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete204_succeeded.metadata = {'url': '/lro/delete/204/succeeded'} def _delete202_retry200_initial( @@ -2019,6 +2250,7 @@ def begin_delete202_retry200( """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2029,10 +2261,12 @@ def begin_delete202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._delete202_retry200_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete202_retry200_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -2048,7 +2282,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry200.metadata = {'url': '/lro/delete/202/retry/200'} def _delete202_no_retry204_initial( @@ -2102,6 +2344,7 @@ def begin_delete202_no_retry204( """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2112,10 +2355,12 @@ def begin_delete202_no_retry204( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._delete202_no_retry204_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete202_no_retry204_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -2131,7 +2376,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_no_retry204.metadata = {'url': '/lro/delete/202/noretry/204'} def _delete_no_header_in_retry_initial( @@ -2178,6 +2431,7 @@ def begin_delete_no_header_in_retry( """Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2188,10 +2442,12 @@ def begin_delete_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete_no_header_in_retry_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_no_header_in_retry_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2204,7 +2460,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_no_header_in_retry.metadata = {'url': '/lro/delete/noheader'} def _delete_async_no_header_in_retry_initial( @@ -2251,6 +2515,7 @@ def begin_delete_async_no_header_in_retry( """Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2261,10 +2526,12 @@ def begin_delete_async_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete_async_no_header_in_retry_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_async_no_header_in_retry_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2277,7 +2544,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_no_header_in_retry.metadata = {'url': '/lro/deleteasync/noheader/202/204'} def _delete_async_retry_succeeded_initial( @@ -2325,6 +2600,7 @@ def begin_delete_async_retry_succeeded( """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2335,10 +2611,12 @@ def begin_delete_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete_async_retry_succeeded_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_async_retry_succeeded_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2351,7 +2629,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retry_succeeded.metadata = {'url': '/lro/deleteasync/retry/succeeded'} def _delete_async_no_retry_succeeded_initial( @@ -2399,6 +2685,7 @@ def begin_delete_async_no_retry_succeeded( """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2409,10 +2696,12 @@ def begin_delete_async_no_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete_async_no_retry_succeeded_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_async_no_retry_succeeded_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2425,7 +2714,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_no_retry_succeeded.metadata = {'url': '/lro/deleteasync/noretry/succeeded'} def _delete_async_retry_failed_initial( @@ -2473,6 +2770,7 @@ def begin_delete_async_retry_failed( """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2483,10 +2781,12 @@ def begin_delete_async_retry_failed( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete_async_retry_failed_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_async_retry_failed_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2499,7 +2799,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retry_failed.metadata = {'url': '/lro/deleteasync/retry/failed'} def _delete_async_retrycanceled_initial( @@ -2547,6 +2855,7 @@ def begin_delete_async_retrycanceled( """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2557,10 +2866,12 @@ def begin_delete_async_retrycanceled( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete_async_retrycanceled_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_async_retrycanceled_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2573,7 +2884,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retrycanceled.metadata = {'url': '/lro/deleteasync/retry/canceled'} def _post200_with_payload_initial( @@ -2625,6 +2944,7 @@ def begin_post200_with_payload( """Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2635,10 +2955,12 @@ def begin_post200_with_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] - raw_result = self._post200_with_payload_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post200_with_payload_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Sku', pipeline_response) @@ -2654,7 +2976,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post200_with_payload.metadata = {'url': '/lro/post/payload/200'} def _post202_retry200_initial( @@ -2714,6 +3044,7 @@ def begin_post202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2724,11 +3055,13 @@ def begin_post202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._post202_retry200_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post202_retry200_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2741,7 +3074,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/post/202/retry/200'} def _post202_no_retry204_initial( @@ -2804,6 +3145,7 @@ def begin_post202_no_retry204( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2814,11 +3156,13 @@ def begin_post202_no_retry204( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._post202_no_retry204_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post202_no_retry204_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -2838,7 +3182,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_no_retry204.metadata = {'url': '/lro/post/202/noretry/204'} def _post_double_headers_final_location_get_initial( @@ -2885,6 +3237,7 @@ def begin_post_double_headers_final_location_get( """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should poll Location to get the final object. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2895,10 +3248,12 @@ def begin_post_double_headers_final_location_get( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._post_double_headers_final_location_get_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_double_headers_final_location_get_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -2914,7 +3269,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_location_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalLocationGet'} def _post_double_headers_final_azure_header_get_initial( @@ -2961,6 +3324,7 @@ def begin_post_double_headers_final_azure_header_get( """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2971,10 +3335,12 @@ def begin_post_double_headers_final_azure_header_get( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._post_double_headers_final_azure_header_get_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_double_headers_final_azure_header_get_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -2990,7 +3356,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_azure_header_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGet'} def _post_double_headers_final_azure_header_get_default_initial( @@ -3037,6 +3411,7 @@ def begin_post_double_headers_final_azure_header_get_default( """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object if you support initial Autorest behavior. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3047,10 +3422,12 @@ def begin_post_double_headers_final_azure_header_get_default( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._post_double_headers_final_azure_header_get_default_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_double_headers_final_azure_header_get_default_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -3066,7 +3443,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_azure_header_get_default.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGetDefault'} def _post_async_retry_succeeded_initial( @@ -3134,6 +3519,7 @@ def begin_post_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3144,11 +3530,13 @@ def begin_post_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._post_async_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_async_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -3164,7 +3552,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_succeeded.metadata = {'url': '/lro/postasync/retry/succeeded'} def _post_async_no_retry_succeeded_initial( @@ -3232,6 +3628,7 @@ def begin_post_async_no_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3242,11 +3639,13 @@ def begin_post_async_no_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._post_async_no_retry_succeeded_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_async_no_retry_succeeded_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -3262,7 +3661,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_no_retry_succeeded.metadata = {'url': '/lro/postasync/noretry/succeeded'} def _post_async_retry_failed_initial( @@ -3323,6 +3730,7 @@ def begin_post_async_retry_failed( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3333,11 +3741,13 @@ def begin_post_async_retry_failed( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._post_async_retry_failed_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_async_retry_failed_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -3350,7 +3760,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_failed.metadata = {'url': '/lro/postasync/retry/failed'} def _post_async_retrycanceled_initial( @@ -3411,6 +3829,7 @@ def begin_post_async_retrycanceled( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3421,11 +3840,13 @@ def begin_post_async_retrycanceled( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._post_async_retrycanceled_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_async_retrycanceled_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -3438,5 +3859,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retrycanceled.metadata = {'url': '/lro/postasync/retry/canceled'} diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py index 543e3113136..3098b110a3c 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py @@ -109,6 +109,7 @@ def begin_put_non_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -119,11 +120,13 @@ def begin_put_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_non_retry400_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_non_retry400_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -139,7 +142,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry400.metadata = {'url': '/lro/nonretryerror/put/400'} def _put_non_retry201_creating400_initial( @@ -204,6 +215,7 @@ def begin_put_non_retry201_creating400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -214,11 +226,13 @@ def begin_put_non_retry201_creating400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_non_retry201_creating400_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_non_retry201_creating400_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -234,7 +248,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry201_creating400.metadata = {'url': '/lro/nonretryerror/put/201/creating/400'} def _put_non_retry201_creating400_invalid_json_initial( @@ -299,6 +321,7 @@ def begin_put_non_retry201_creating400_invalid_json( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -309,11 +332,13 @@ def begin_put_non_retry201_creating400_invalid_json( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_non_retry201_creating400_invalid_json_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_non_retry201_creating400_invalid_json_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -329,7 +354,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry201_creating400_invalid_json.metadata = {'url': '/lro/nonretryerror/put/201/creating/400/invalidjson'} def _put_async_relative_retry400_initial( @@ -393,6 +426,7 @@ def begin_put_async_relative_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -403,11 +437,13 @@ def begin_put_async_relative_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_async_relative_retry400_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_async_relative_retry400_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -428,7 +464,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/putasync/retry/400'} def _delete_non_retry400_initial( @@ -475,6 +519,7 @@ def begin_delete_non_retry400( """Long running delete request, service returns a 400 with an error body. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -485,10 +530,12 @@ def begin_delete_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete_non_retry400_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_non_retry400_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -501,7 +548,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/400'} def _delete202_non_retry400_initial( @@ -548,6 +603,7 @@ def begin_delete202_non_retry400( """Long running delete request, service returns a 202 with a location header. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -558,10 +614,12 @@ def begin_delete202_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete202_non_retry400_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete202_non_retry400_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -574,7 +632,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/202/retry/400'} def _delete_async_relative_retry400_initial( @@ -622,6 +688,7 @@ def begin_delete_async_relative_retry400( """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -632,10 +699,12 @@ def begin_delete_async_relative_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete_async_relative_retry400_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_async_relative_retry400_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -648,7 +717,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/deleteasync/retry/400'} def _post_non_retry400_initial( @@ -708,6 +785,7 @@ def begin_post_non_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -718,11 +796,13 @@ def begin_post_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._post_non_retry400_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_non_retry400_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -735,7 +815,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_non_retry400.metadata = {'url': '/lro/nonretryerror/post/400'} def _post202_non_retry400_initial( @@ -795,6 +883,7 @@ def begin_post202_non_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -805,11 +894,13 @@ def begin_post202_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._post202_non_retry400_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post202_non_retry400_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -822,7 +913,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_non_retry400.metadata = {'url': '/lro/nonretryerror/post/202/retry/400'} def _post_async_relative_retry400_initial( @@ -883,6 +982,7 @@ def begin_post_async_relative_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -893,11 +993,13 @@ def begin_post_async_relative_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._post_async_relative_retry400_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_async_relative_retry400_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -910,7 +1012,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/postasync/retry/400'} def _put_error201_no_provisioning_state_payload_initial( @@ -975,6 +1085,7 @@ def begin_put_error201_no_provisioning_state_payload( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -985,11 +1096,13 @@ def begin_put_error201_no_provisioning_state_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_error201_no_provisioning_state_payload_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_error201_no_provisioning_state_payload_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -1005,7 +1118,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_error201_no_provisioning_state_payload.metadata = {'url': '/lro/error/put/201/noprovisioningstatepayload'} def _put_async_relative_retry_no_status_initial( @@ -1069,6 +1190,7 @@ def begin_put_async_relative_retry_no_status( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1079,11 +1201,13 @@ def begin_put_async_relative_retry_no_status( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_async_relative_retry_no_status_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_async_relative_retry_no_status_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1104,7 +1228,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_no_status.metadata = {'url': '/lro/error/putasync/retry/nostatus'} def _put_async_relative_retry_no_status_payload_initial( @@ -1168,6 +1300,7 @@ def begin_put_async_relative_retry_no_status_payload( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1178,11 +1311,13 @@ def begin_put_async_relative_retry_no_status_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_async_relative_retry_no_status_payload_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_async_relative_retry_no_status_payload_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1203,7 +1338,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_no_status_payload.metadata = {'url': '/lro/error/putasync/retry/nostatuspayload'} def _delete204_succeeded_initial( @@ -1246,6 +1389,7 @@ def begin_delete204_succeeded( """Long running delete request, service returns a 204 to the initial request, indicating success. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1256,10 +1400,12 @@ def begin_delete204_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete204_succeeded_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete204_succeeded_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -1272,7 +1418,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete204_succeeded.metadata = {'url': '/lro/error/delete/204/nolocation'} def _delete_async_relative_retry_no_status_initial( @@ -1320,6 +1474,7 @@ def begin_delete_async_relative_retry_no_status( """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1330,10 +1485,12 @@ def begin_delete_async_relative_retry_no_status( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete_async_relative_retry_no_status_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_async_relative_retry_no_status_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -1346,7 +1503,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_no_status.metadata = {'url': '/lro/error/deleteasync/retry/nostatus'} def _post202_no_location_initial( @@ -1406,6 +1571,7 @@ def begin_post202_no_location( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1416,11 +1582,13 @@ def begin_post202_no_location( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._post202_no_location_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post202_no_location_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -1433,7 +1601,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_no_location.metadata = {'url': '/lro/error/post/202/nolocation'} def _post_async_relative_retry_no_payload_initial( @@ -1494,6 +1670,7 @@ def begin_post_async_relative_retry_no_payload( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1504,11 +1681,13 @@ def begin_post_async_relative_retry_no_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._post_async_relative_retry_no_payload_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_async_relative_retry_no_payload_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -1521,7 +1700,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_no_payload.metadata = {'url': '/lro/error/postasync/retry/nopayload'} def _put200_invalid_json_initial( @@ -1583,6 +1770,7 @@ def begin_put200_invalid_json( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1593,11 +1781,13 @@ def begin_put200_invalid_json( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put200_invalid_json_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put200_invalid_json_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): deserialized = self._deserialize('Product', pipeline_response) @@ -1613,7 +1803,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_invalid_json.metadata = {'url': '/lro/error/put/200/invalidjson'} def _put_async_relative_retry_invalid_header_initial( @@ -1677,6 +1875,7 @@ def begin_put_async_relative_retry_invalid_header( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1687,11 +1886,13 @@ def begin_put_async_relative_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_async_relative_retry_invalid_header_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_async_relative_retry_invalid_header_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1712,7 +1913,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/putasync/retry/invalidheader'} def _put_async_relative_retry_invalid_json_polling_initial( @@ -1776,6 +1985,7 @@ def begin_put_async_relative_retry_invalid_json_polling( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1786,11 +1996,13 @@ def begin_put_async_relative_retry_invalid_json_polling( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] - raw_result = self._put_async_relative_retry_invalid_json_polling_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._put_async_relative_retry_invalid_json_polling_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): response_headers = {} @@ -1811,7 +2023,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/putasync/retry/invalidjsonpolling'} def _delete202_retry_invalid_header_initial( @@ -1858,6 +2078,7 @@ def begin_delete202_retry_invalid_header( """Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1868,10 +2089,12 @@ def begin_delete202_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete202_retry_invalid_header_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete202_retry_invalid_header_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -1884,7 +2107,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry_invalid_header.metadata = {'url': '/lro/error/delete/202/retry/invalidheader'} def _delete_async_relative_retry_invalid_header_initial( @@ -1932,6 +2163,7 @@ def begin_delete_async_relative_retry_invalid_header( """Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1942,10 +2174,12 @@ def begin_delete_async_relative_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete_async_relative_retry_invalid_header_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_async_relative_retry_invalid_header_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -1958,7 +2192,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/deleteasync/retry/invalidheader'} def _delete_async_relative_retry_invalid_json_polling_initial( @@ -2006,6 +2248,7 @@ def begin_delete_async_relative_retry_invalid_json_polling( """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2016,10 +2259,12 @@ def begin_delete_async_relative_retry_invalid_json_polling( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._delete_async_relative_retry_invalid_json_polling_initial( - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_async_relative_retry_invalid_json_polling_initial( + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2032,7 +2277,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/deleteasync/retry/invalidjsonpolling'} def _post202_retry_invalid_header_initial( @@ -2092,6 +2345,7 @@ def begin_post202_retry_invalid_header( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2102,11 +2356,13 @@ def begin_post202_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._post202_retry_invalid_header_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post202_retry_invalid_header_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2119,7 +2375,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry_invalid_header.metadata = {'url': '/lro/error/post/202/retry/invalidheader'} def _post_async_relative_retry_invalid_header_initial( @@ -2180,6 +2444,7 @@ def begin_post_async_relative_retry_invalid_header( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2190,11 +2455,13 @@ def begin_post_async_relative_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._post_async_relative_retry_invalid_header_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_async_relative_retry_invalid_header_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2207,7 +2474,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/postasync/retry/invalidheader'} def _post_async_relative_retry_invalid_json_polling_initial( @@ -2268,6 +2543,7 @@ def begin_post_async_relative_retry_invalid_json_polling( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2278,11 +2554,13 @@ def begin_post_async_relative_retry_invalid_json_polling( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] - raw_result = self._post_async_relative_retry_invalid_json_polling_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._post_async_relative_retry_invalid_json_polling_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) def get_long_running_output(pipeline_response): if cls: @@ -2295,5 +2573,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/postasync/retry/invalidjsonpolling'} diff --git a/test/azure/requirements.txt b/test/azure/requirements.txt index 81c18d7b2bc..af1b95e655d 100644 --- a/test/azure/requirements.txt +++ b/test/azure/requirements.txt @@ -3,8 +3,8 @@ pytest pytest-cov pytest-asyncio;python_full_version>="3.5.2" async_generator;python_full_version>="3.5.2" -azure-core>=1.4.0 -azure-mgmt-core>=1.0.0 +git+https://github.com/Azure/azure-sdk-for-python@lro_continuation_token#subdirectory=sdk/core/azure-core&egg=azure-core +git+https://github.com/Azure/azure-sdk-for-python@lro_continuation_token#subdirectory=sdk/core/azure-mgmt-core&egg=azure-mgmt-core msrest>=0.6.10 aiohttp;python_full_version>="3.5.2" -e ./Expected/AcceptanceTests/AzureBodyDuration From 7866ca9a9414778a8a4bd04b65cd2f403f5d24f4 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 10 Apr 2020 16:41:42 -0700 Subject: [PATCH 02/26] Test --- test/azure/AcceptanceTests/test_lro.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/azure/AcceptanceTests/test_lro.py b/test/azure/AcceptanceTests/test_lro.py index 489ae258b1b..5bae0610be9 100644 --- a/test/azure/AcceptanceTests/test_lro.py +++ b/test/azure/AcceptanceTests/test_lro.py @@ -127,6 +127,15 @@ def lro_result(self, func, *args, **kwargs): kwargs["polling"] = AutorestTestARMPolling(0) return func(*args, **kwargs).result() + def test_post_double_headers_final_continuation_token(self, client): + poller = client.lros.begin_post_double_headers_final_location_get() + continuation_token = poller.continuation_token() + print(continuation_token) + + poller = client.lros.begin_post_double_headers_final_location_get(continuation_token=continuation_token) + product = poller.result() + assert product.id == "100" + def test_post_double_headers_final(self, client): product = client.lros.begin_post_double_headers_final_location_get().result() assert product.id == "100" From 4f4fefa2aae5e647a8ce2a8d41003fc5b072995a Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 10 Apr 2020 16:44:24 -0700 Subject: [PATCH 03/26] No print --- test/azure/AcceptanceTests/test_lro.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/azure/AcceptanceTests/test_lro.py b/test/azure/AcceptanceTests/test_lro.py index 5bae0610be9..98d642506a2 100644 --- a/test/azure/AcceptanceTests/test_lro.py +++ b/test/azure/AcceptanceTests/test_lro.py @@ -130,7 +130,6 @@ def lro_result(self, func, *args, **kwargs): def test_post_double_headers_final_continuation_token(self, client): poller = client.lros.begin_post_double_headers_final_location_get() continuation_token = poller.continuation_token() - print(continuation_token) poller = client.lros.begin_post_double_headers_final_location_get(continuation_token=continuation_token) product = poller.result() From 7917df29e698e68fef36b408edd3da12b46ba9a6 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 13 Apr 2020 16:28:53 -0700 Subject: [PATCH 04/26] Async poller --- autorest/codegen/models/lro_operation.py | 2 +- .../codegen/templates/lro_operation.py.jinja2 | 30 +- .../_lr_os_custom_header_operations_async.py | 78 +- .../_lro_retrys_operations_async.py | 129 +++- .../_lros_operations_async.py | 711 ++++++++++++++---- .../_lrosads_operations_async.py | 480 +++++++++--- .../_lr_os_custom_header_operations.py | 48 ++ .../lro/operations/_lro_retrys_operations.py | 78 ++ .../Lro/lro/operations/_lros_operations.py | 436 +++++++++++ .../Lro/lro/operations/_lrosads_operations.py | 296 ++++++++ 10 files changed, 1974 insertions(+), 314 deletions(-) diff --git a/autorest/codegen/models/lro_operation.py b/autorest/codegen/models/lro_operation.py index d476b951361..6de3e5ec82c 100644 --- a/autorest/codegen/models/lro_operation.py +++ b/autorest/codegen/models/lro_operation.py @@ -83,7 +83,7 @@ def imports(self, code_model, async_mode: bool) -> FileImport: file_import.add_from_import("typing", "Union", ImportType.STDLIB, TypingSection.CONDITIONAL) if async_mode: file_import.add_from_import("typing", "Optional", ImportType.STDLIB, TypingSection.CONDITIONAL) - file_import.add_from_import("azure.core.polling", "async_poller", ImportType.AZURECORE) + file_import.add_from_import("azure.core.polling", "AsyncLROPoller", ImportType.AZURECORE) file_import.add_from_import("azure.core.polling", "AsyncNoPolling", ImportType.AZURECORE) file_import.add_from_import("azure.core.polling", "AsyncPollingMethod", ImportType.AZURECORE) if code_model.options['azure_arm']: diff --git a/autorest/codegen/templates/lro_operation.py.jinja2 b/autorest/codegen/templates/lro_operation.py.jinja2 index 51bc01d4207..59d31b464f8 100644 --- a/autorest/codegen/templates/lro_operation.py.jinja2 +++ b/autorest/codegen/templates/lro_operation.py.jinja2 @@ -2,8 +2,8 @@ {% import 'operation_tools.jinja2' as op_tools %} {% set trace_decorator = "@distributed_trace_async" if async_mode else "@distributed_trace" %} {% set async_prefix = "Async" if async_mode else "" %} -{% set poller = "async_poller" if async_mode else "LROPoller" %} -{% set operation_name = operation.python_name if async_mode else "begin_"+operation.python_name %} +{% set poller = "AsyncLROPoller" if async_mode else "LROPoller" %} +{% set operation_name = "begin_"+operation.python_name %} {% macro return_docstring() %} :return: An instance of LROPoller that returns {{ operation.responses[0].schema.name if operation.responses[0].has_body else "None"}} :rtype: ~azure.core.polling.LROPoller[{{ operation.responses[0].schema.docstring_type if operation.responses[0].has_body else "None" }}] @@ -88,12 +88,32 @@ response_headers = { elif polling is False: polling_method = {{ async_prefix }}NoPolling() else: polling_method = polling if cont_token: - return {{ keywords.await }}{{ poller }}.from_continuation_token( + return {{ poller }}.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return {{ keywords.await }}{{ poller }}(self._client, raw_result, get_long_running_output, polling_method) -{{ operation_name }}.metadata = {'url': '{{ operation.url }}'} \ No newline at end of file + return {{ poller }}(self._client, raw_result, get_long_running_output, polling_method) +{{ operation_name }}.metadata = {'url': '{{ operation.url }}'} + +{{ op_tools.method_signature(operation, operation.python_name, async_mode=async_mode, coroutine=async_mode) }} +{%- if not async_mode %} + {{ keywords.sync_return_type_annotation(operation) }} +{% endif %} +{% if async_mode %} + return await (await self.begin_{{ operation.python_name }}( + {% for param_signature in operation.parameters.method %} + {{ param_signature.serialized_name }}={{ param_signature.serialized_name }}, + {% endfor %} + **kwargs + )) +{% else %} + return self.begin_{{ operation.python_name }}( + {% for param_signature in operation.parameters.method %} + {{ param_signature.serialized_name }}={{ param_signature.serialized_name }}, + {% endfor %} + **kwargs + ).result() +{% endif %} diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py index 38e10e1e9dd..3baaeae383e 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py @@ -11,7 +11,7 @@ from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling @@ -92,7 +92,7 @@ async def _put_async_retry_succeeded_initial( _put_async_retry_succeeded_initial.metadata = {'url': '/lro/customheader/putasync/retry/succeeded'} @distributed_trace_async - async def put_async_retry_succeeded( + async def begin_put_async_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs @@ -141,15 +141,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_async_retry_succeeded.metadata = {'url': '/lro/customheader/putasync/retry/succeeded'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_async_retry_succeeded.metadata = {'url': '/lro/customheader/putasync/retry/succeeded'} + + async def put_async_retry_succeeded( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_async_retry_succeeded( + product=product, + **kwargs + )) + async def _put201_creating_succeeded200_initial( self, @@ -201,7 +212,7 @@ async def _put201_creating_succeeded200_initial( _put201_creating_succeeded200_initial.metadata = {'url': '/lro/customheader/put/201/creating/succeeded/200'} @distributed_trace_async - async def put201_creating_succeeded200( + async def begin_put201_creating_succeeded200( self, product: Optional["models.Product"] = None, **kwargs @@ -245,15 +256,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put201_creating_succeeded200.metadata = {'url': '/lro/customheader/put/201/creating/succeeded/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put201_creating_succeeded200.metadata = {'url': '/lro/customheader/put/201/creating/succeeded/200'} + + async def put201_creating_succeeded200( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put201_creating_succeeded200( + product=product, + **kwargs + )) + async def _post202_retry200_initial( self, @@ -300,7 +322,7 @@ async def _post202_retry200_initial( _post202_retry200_initial.metadata = {'url': '/lro/customheader/post/202/retry/200'} @distributed_trace_async - async def post202_retry200( + async def begin_post202_retry200( self, product: Optional["models.Product"] = None, **kwargs @@ -341,15 +363,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post202_retry200.metadata = {'url': '/lro/customheader/post/202/retry/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post202_retry200.metadata = {'url': '/lro/customheader/post/202/retry/200'} + + async def post202_retry200( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> None: + return await (await self.begin_post202_retry200( + product=product, + **kwargs + )) + async def _post_async_retry_succeeded_initial( self, @@ -397,7 +430,7 @@ async def _post_async_retry_succeeded_initial( _post_async_retry_succeeded_initial.metadata = {'url': '/lro/customheader/postasync/retry/succeeded'} @distributed_trace_async - async def post_async_retry_succeeded( + async def begin_post_async_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs @@ -438,12 +471,23 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post_async_retry_succeeded.metadata = {'url': '/lro/customheader/postasync/retry/succeeded'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_async_retry_succeeded.metadata = {'url': '/lro/customheader/postasync/retry/succeeded'} + + async def post_async_retry_succeeded( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> None: + return await (await self.begin_post_async_retry_succeeded( + product=product, + **kwargs + )) + diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py index 41e9450701b..c15fcdfd6c4 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py @@ -11,7 +11,7 @@ from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling @@ -93,7 +93,7 @@ async def _put201_creating_succeeded200_initial( _put201_creating_succeeded200_initial.metadata = {'url': '/lro/retryerror/put/201/creating/succeeded/200'} @distributed_trace_async - async def put201_creating_succeeded200( + async def begin_put201_creating_succeeded200( self, product: Optional["models.Product"] = None, **kwargs @@ -137,15 +137,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put201_creating_succeeded200.metadata = {'url': '/lro/retryerror/put/201/creating/succeeded/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put201_creating_succeeded200.metadata = {'url': '/lro/retryerror/put/201/creating/succeeded/200'} + + async def put201_creating_succeeded200( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put201_creating_succeeded200( + product=product, + **kwargs + )) + async def _put_async_relative_retry_succeeded_initial( self, @@ -196,7 +207,7 @@ async def _put_async_relative_retry_succeeded_initial( _put_async_relative_retry_succeeded_initial.metadata = {'url': '/lro/retryerror/putasync/retry/succeeded'} @distributed_trace_async - async def put_async_relative_retry_succeeded( + async def begin_put_async_relative_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs @@ -245,15 +256,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/putasync/retry/succeeded'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/putasync/retry/succeeded'} + + async def put_async_relative_retry_succeeded( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_async_relative_retry_succeeded( + product=product, + **kwargs + )) + async def _delete_provisioning202_accepted200_succeeded_initial( self, @@ -298,7 +320,7 @@ async def _delete_provisioning202_accepted200_succeeded_initial( _delete_provisioning202_accepted200_succeeded_initial.metadata = {'url': '/lro/retryerror/delete/provisioning/202/accepted/200/succeeded'} @distributed_trace_async - async def delete_provisioning202_accepted200_succeeded( + async def begin_delete_provisioning202_accepted200_succeeded( self, **kwargs ) -> "models.Product": @@ -342,15 +364,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/retryerror/delete/provisioning/202/accepted/200/succeeded'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/retryerror/delete/provisioning/202/accepted/200/succeeded'} + + async def delete_provisioning202_accepted200_succeeded( + self, + **kwargs + ) -> "models.Product": + return await (await self.begin_delete_provisioning202_accepted200_succeeded( + **kwargs + )) + async def _delete202_retry200_initial( self, @@ -387,7 +418,7 @@ async def _delete202_retry200_initial( _delete202_retry200_initial.metadata = {'url': '/lro/retryerror/delete/202/retry/200'} @distributed_trace_async - async def delete202_retry200( + async def begin_delete202_retry200( self, **kwargs ) -> None: @@ -424,15 +455,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete202_retry200.metadata = {'url': '/lro/retryerror/delete/202/retry/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete202_retry200.metadata = {'url': '/lro/retryerror/delete/202/retry/200'} + + async def delete202_retry200( + self, + **kwargs + ) -> None: + return await (await self.begin_delete202_retry200( + **kwargs + )) + async def _delete_async_relative_retry_succeeded_initial( self, @@ -470,7 +510,7 @@ async def _delete_async_relative_retry_succeeded_initial( _delete_async_relative_retry_succeeded_initial.metadata = {'url': '/lro/retryerror/deleteasync/retry/succeeded'} @distributed_trace_async - async def delete_async_relative_retry_succeeded( + async def begin_delete_async_relative_retry_succeeded( self, **kwargs ) -> None: @@ -507,15 +547,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/deleteasync/retry/succeeded'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/deleteasync/retry/succeeded'} + + async def delete_async_relative_retry_succeeded( + self, + **kwargs + ) -> None: + return await (await self.begin_delete_async_relative_retry_succeeded( + **kwargs + )) + async def _post202_retry200_initial( self, @@ -562,7 +611,7 @@ async def _post202_retry200_initial( _post202_retry200_initial.metadata = {'url': '/lro/retryerror/post/202/retry/200'} @distributed_trace_async - async def post202_retry200( + async def begin_post202_retry200( self, product: Optional["models.Product"] = None, **kwargs @@ -603,15 +652,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post202_retry200.metadata = {'url': '/lro/retryerror/post/202/retry/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post202_retry200.metadata = {'url': '/lro/retryerror/post/202/retry/200'} + + async def post202_retry200( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> None: + return await (await self.begin_post202_retry200( + product=product, + **kwargs + )) + async def _post_async_relative_retry_succeeded_initial( self, @@ -659,7 +719,7 @@ async def _post_async_relative_retry_succeeded_initial( _post_async_relative_retry_succeeded_initial.metadata = {'url': '/lro/retryerror/postasync/retry/succeeded'} @distributed_trace_async - async def post_async_relative_retry_succeeded( + async def begin_post_async_relative_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs @@ -700,12 +760,23 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/postasync/retry/succeeded'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/postasync/retry/succeeded'} + + async def post_async_relative_retry_succeeded( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> None: + return await (await self.begin_post_async_relative_retry_succeeded( + product=product, + **kwargs + )) + diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py index 65c748bfdf9..d85430552b6 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py @@ -11,7 +11,7 @@ from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling @@ -90,7 +90,7 @@ async def _put200_succeeded_initial( _put200_succeeded_initial.metadata = {'url': '/lro/put/200/succeeded'} @distributed_trace_async - async def put200_succeeded( + async def begin_put200_succeeded( self, product: Optional["models.Product"] = None, **kwargs @@ -134,15 +134,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put200_succeeded.metadata = {'url': '/lro/put/200/succeeded'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put200_succeeded.metadata = {'url': '/lro/put/200/succeeded'} + + async def put200_succeeded( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put200_succeeded( + product=product, + **kwargs + )) + async def _put200_succeeded_no_state_initial( self, @@ -189,7 +200,7 @@ async def _put200_succeeded_no_state_initial( _put200_succeeded_no_state_initial.metadata = {'url': '/lro/put/200/succeeded/nostate'} @distributed_trace_async - async def put200_succeeded_no_state( + async def begin_put200_succeeded_no_state( self, product: Optional["models.Product"] = None, **kwargs @@ -233,15 +244,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put200_succeeded_no_state.metadata = {'url': '/lro/put/200/succeeded/nostate'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put200_succeeded_no_state.metadata = {'url': '/lro/put/200/succeeded/nostate'} + + async def put200_succeeded_no_state( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put200_succeeded_no_state( + product=product, + **kwargs + )) + async def _put202_retry200_initial( self, @@ -288,7 +310,7 @@ async def _put202_retry200_initial( _put202_retry200_initial.metadata = {'url': '/lro/put/202/retry/200'} @distributed_trace_async - async def put202_retry200( + async def begin_put202_retry200( self, product: Optional["models.Product"] = None, **kwargs @@ -332,15 +354,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put202_retry200.metadata = {'url': '/lro/put/202/retry/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put202_retry200.metadata = {'url': '/lro/put/202/retry/200'} + + async def put202_retry200( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put202_retry200( + product=product, + **kwargs + )) + async def _put201_creating_succeeded200_initial( self, @@ -392,7 +425,7 @@ async def _put201_creating_succeeded200_initial( _put201_creating_succeeded200_initial.metadata = {'url': '/lro/put/201/creating/succeeded/200'} @distributed_trace_async - async def put201_creating_succeeded200( + async def begin_put201_creating_succeeded200( self, product: Optional["models.Product"] = None, **kwargs @@ -436,15 +469,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put201_creating_succeeded200.metadata = {'url': '/lro/put/201/creating/succeeded/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put201_creating_succeeded200.metadata = {'url': '/lro/put/201/creating/succeeded/200'} + + async def put201_creating_succeeded200( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put201_creating_succeeded200( + product=product, + **kwargs + )) + async def _put200_updating_succeeded204_initial( self, @@ -491,7 +535,7 @@ async def _put200_updating_succeeded204_initial( _put200_updating_succeeded204_initial.metadata = {'url': '/lro/put/200/updating/succeeded/200'} @distributed_trace_async - async def put200_updating_succeeded204( + async def begin_put200_updating_succeeded204( self, product: Optional["models.Product"] = None, **kwargs @@ -535,15 +579,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put200_updating_succeeded204.metadata = {'url': '/lro/put/200/updating/succeeded/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put200_updating_succeeded204.metadata = {'url': '/lro/put/200/updating/succeeded/200'} + + async def put200_updating_succeeded204( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put200_updating_succeeded204( + product=product, + **kwargs + )) + async def _put201_creating_failed200_initial( self, @@ -595,7 +650,7 @@ async def _put201_creating_failed200_initial( _put201_creating_failed200_initial.metadata = {'url': '/lro/put/201/created/failed/200'} @distributed_trace_async - async def put201_creating_failed200( + async def begin_put201_creating_failed200( self, product: Optional["models.Product"] = None, **kwargs @@ -639,15 +694,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put201_creating_failed200.metadata = {'url': '/lro/put/201/created/failed/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put201_creating_failed200.metadata = {'url': '/lro/put/201/created/failed/200'} + + async def put201_creating_failed200( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put201_creating_failed200( + product=product, + **kwargs + )) + async def _put200_acceptedcanceled200_initial( self, @@ -694,7 +760,7 @@ async def _put200_acceptedcanceled200_initial( _put200_acceptedcanceled200_initial.metadata = {'url': '/lro/put/200/accepted/canceled/200'} @distributed_trace_async - async def put200_acceptedcanceled200( + async def begin_put200_acceptedcanceled200( self, product: Optional["models.Product"] = None, **kwargs @@ -738,15 +804,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put200_acceptedcanceled200.metadata = {'url': '/lro/put/200/accepted/canceled/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put200_acceptedcanceled200.metadata = {'url': '/lro/put/200/accepted/canceled/200'} + + async def put200_acceptedcanceled200( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put200_acceptedcanceled200( + product=product, + **kwargs + )) + async def _put_no_header_in_retry_initial( self, @@ -795,7 +872,7 @@ async def _put_no_header_in_retry_initial( _put_no_header_in_retry_initial.metadata = {'url': '/lro/put/noheader/202/200'} @distributed_trace_async - async def put_no_header_in_retry( + async def begin_put_no_header_in_retry( self, product: Optional["models.Product"] = None, **kwargs @@ -842,15 +919,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_no_header_in_retry.metadata = {'url': '/lro/put/noheader/202/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_no_header_in_retry.metadata = {'url': '/lro/put/noheader/202/200'} + + async def put_no_header_in_retry( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_no_header_in_retry( + product=product, + **kwargs + )) + async def _put_async_retry_succeeded_initial( self, @@ -901,7 +989,7 @@ async def _put_async_retry_succeeded_initial( _put_async_retry_succeeded_initial.metadata = {'url': '/lro/putasync/retry/succeeded'} @distributed_trace_async - async def put_async_retry_succeeded( + async def begin_put_async_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs @@ -950,15 +1038,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_async_retry_succeeded.metadata = {'url': '/lro/putasync/retry/succeeded'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_async_retry_succeeded.metadata = {'url': '/lro/putasync/retry/succeeded'} + + async def put_async_retry_succeeded( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_async_retry_succeeded( + product=product, + **kwargs + )) + async def _put_async_no_retry_succeeded_initial( self, @@ -1008,7 +1107,7 @@ async def _put_async_no_retry_succeeded_initial( _put_async_no_retry_succeeded_initial.metadata = {'url': '/lro/putasync/noretry/succeeded'} @distributed_trace_async - async def put_async_no_retry_succeeded( + async def begin_put_async_no_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs @@ -1056,15 +1155,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_async_no_retry_succeeded.metadata = {'url': '/lro/putasync/noretry/succeeded'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_async_no_retry_succeeded.metadata = {'url': '/lro/putasync/noretry/succeeded'} + + async def put_async_no_retry_succeeded( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_async_no_retry_succeeded( + product=product, + **kwargs + )) + async def _put_async_retry_failed_initial( self, @@ -1115,7 +1225,7 @@ async def _put_async_retry_failed_initial( _put_async_retry_failed_initial.metadata = {'url': '/lro/putasync/retry/failed'} @distributed_trace_async - async def put_async_retry_failed( + async def begin_put_async_retry_failed( self, product: Optional["models.Product"] = None, **kwargs @@ -1164,15 +1274,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_async_retry_failed.metadata = {'url': '/lro/putasync/retry/failed'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_async_retry_failed.metadata = {'url': '/lro/putasync/retry/failed'} + + async def put_async_retry_failed( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_async_retry_failed( + product=product, + **kwargs + )) + async def _put_async_no_retrycanceled_initial( self, @@ -1222,7 +1343,7 @@ async def _put_async_no_retrycanceled_initial( _put_async_no_retrycanceled_initial.metadata = {'url': '/lro/putasync/noretry/canceled'} @distributed_trace_async - async def put_async_no_retrycanceled( + async def begin_put_async_no_retrycanceled( self, product: Optional["models.Product"] = None, **kwargs @@ -1270,15 +1391,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_async_no_retrycanceled.metadata = {'url': '/lro/putasync/noretry/canceled'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_async_no_retrycanceled.metadata = {'url': '/lro/putasync/noretry/canceled'} + + async def put_async_no_retrycanceled( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_async_no_retrycanceled( + product=product, + **kwargs + )) + async def _put_async_no_header_in_retry_initial( self, @@ -1327,7 +1459,7 @@ async def _put_async_no_header_in_retry_initial( _put_async_no_header_in_retry_initial.metadata = {'url': '/lro/putasync/noheader/201/200'} @distributed_trace_async - async def put_async_no_header_in_retry( + async def begin_put_async_no_header_in_retry( self, product: Optional["models.Product"] = None, **kwargs @@ -1374,15 +1506,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_async_no_header_in_retry.metadata = {'url': '/lro/putasync/noheader/201/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_async_no_header_in_retry.metadata = {'url': '/lro/putasync/noheader/201/200'} + + async def put_async_no_header_in_retry( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_async_no_header_in_retry( + product=product, + **kwargs + )) + async def _put_non_resource_initial( self, @@ -1429,7 +1572,7 @@ async def _put_non_resource_initial( _put_non_resource_initial.metadata = {'url': '/lro/putnonresource/202/200'} @distributed_trace_async - async def put_non_resource( + async def begin_put_non_resource( self, sku: Optional["models.Sku"] = None, **kwargs @@ -1473,15 +1616,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_non_resource.metadata = {'url': '/lro/putnonresource/202/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_non_resource.metadata = {'url': '/lro/putnonresource/202/200'} + + async def put_non_resource( + self, + sku: Optional["models.Sku"] = None, + **kwargs + ) -> "models.Sku": + return await (await self.begin_put_non_resource( + sku=sku, + **kwargs + )) + async def _put_async_non_resource_initial( self, @@ -1528,7 +1682,7 @@ async def _put_async_non_resource_initial( _put_async_non_resource_initial.metadata = {'url': '/lro/putnonresourceasync/202/200'} @distributed_trace_async - async def put_async_non_resource( + async def begin_put_async_non_resource( self, sku: Optional["models.Sku"] = None, **kwargs @@ -1572,15 +1726,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_async_non_resource.metadata = {'url': '/lro/putnonresourceasync/202/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_async_non_resource.metadata = {'url': '/lro/putnonresourceasync/202/200'} + + async def put_async_non_resource( + self, + sku: Optional["models.Sku"] = None, + **kwargs + ) -> "models.Sku": + return await (await self.begin_put_async_non_resource( + sku=sku, + **kwargs + )) + async def _put_sub_resource_initial( self, @@ -1629,7 +1794,7 @@ async def _put_sub_resource_initial( _put_sub_resource_initial.metadata = {'url': '/lro/putsubresource/202/200'} @distributed_trace_async - async def put_sub_resource( + async def begin_put_sub_resource( self, provisioning_state: Optional[str] = None, **kwargs @@ -1673,15 +1838,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_sub_resource.metadata = {'url': '/lro/putsubresource/202/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_sub_resource.metadata = {'url': '/lro/putsubresource/202/200'} + + async def put_sub_resource( + self, + provisioning_state: Optional[str] = None, + **kwargs + ) -> "models.SubProduct": + return await (await self.begin_put_sub_resource( + provisioning_state=provisioning_state, + **kwargs + )) + async def _put_async_sub_resource_initial( self, @@ -1730,7 +1906,7 @@ async def _put_async_sub_resource_initial( _put_async_sub_resource_initial.metadata = {'url': '/lro/putsubresourceasync/202/200'} @distributed_trace_async - async def put_async_sub_resource( + async def begin_put_async_sub_resource( self, provisioning_state: Optional[str] = None, **kwargs @@ -1774,15 +1950,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_async_sub_resource.metadata = {'url': '/lro/putsubresourceasync/202/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_async_sub_resource.metadata = {'url': '/lro/putsubresourceasync/202/200'} + + async def put_async_sub_resource( + self, + provisioning_state: Optional[str] = None, + **kwargs + ) -> "models.SubProduct": + return await (await self.begin_put_async_sub_resource( + provisioning_state=provisioning_state, + **kwargs + )) + async def _delete_provisioning202_accepted200_succeeded_initial( self, @@ -1827,7 +2014,7 @@ async def _delete_provisioning202_accepted200_succeeded_initial( _delete_provisioning202_accepted200_succeeded_initial.metadata = {'url': '/lro/delete/provisioning/202/accepted/200/succeeded'} @distributed_trace_async - async def delete_provisioning202_accepted200_succeeded( + async def begin_delete_provisioning202_accepted200_succeeded( self, **kwargs ) -> "models.Product": @@ -1871,15 +2058,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/delete/provisioning/202/accepted/200/succeeded'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/delete/provisioning/202/accepted/200/succeeded'} + + async def delete_provisioning202_accepted200_succeeded( + self, + **kwargs + ) -> "models.Product": + return await (await self.begin_delete_provisioning202_accepted200_succeeded( + **kwargs + )) + async def _delete_provisioning202_deleting_failed200_initial( self, @@ -1924,7 +2120,7 @@ async def _delete_provisioning202_deleting_failed200_initial( _delete_provisioning202_deleting_failed200_initial.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/failed'} @distributed_trace_async - async def delete_provisioning202_deleting_failed200( + async def begin_delete_provisioning202_deleting_failed200( self, **kwargs ) -> "models.Product": @@ -1968,15 +2164,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_provisioning202_deleting_failed200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/failed'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_provisioning202_deleting_failed200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/failed'} + + async def delete_provisioning202_deleting_failed200( + self, + **kwargs + ) -> "models.Product": + return await (await self.begin_delete_provisioning202_deleting_failed200( + **kwargs + )) + async def _delete_provisioning202_deletingcanceled200_initial( self, @@ -2021,7 +2226,7 @@ async def _delete_provisioning202_deletingcanceled200_initial( _delete_provisioning202_deletingcanceled200_initial.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/canceled'} @distributed_trace_async - async def delete_provisioning202_deletingcanceled200( + async def begin_delete_provisioning202_deletingcanceled200( self, **kwargs ) -> "models.Product": @@ -2065,15 +2270,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_provisioning202_deletingcanceled200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/canceled'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_provisioning202_deletingcanceled200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/canceled'} + + async def delete_provisioning202_deletingcanceled200( + self, + **kwargs + ) -> "models.Product": + return await (await self.begin_delete_provisioning202_deletingcanceled200( + **kwargs + )) + async def _delete204_succeeded_initial( self, @@ -2106,7 +2320,7 @@ async def _delete204_succeeded_initial( _delete204_succeeded_initial.metadata = {'url': '/lro/delete/204/succeeded'} @distributed_trace_async - async def delete204_succeeded( + async def begin_delete204_succeeded( self, **kwargs ) -> None: @@ -2143,15 +2357,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete204_succeeded.metadata = {'url': '/lro/delete/204/succeeded'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete204_succeeded.metadata = {'url': '/lro/delete/204/succeeded'} + + async def delete204_succeeded( + self, + **kwargs + ) -> None: + return await (await self.begin_delete204_succeeded( + **kwargs + )) + async def _delete202_retry200_initial( self, @@ -2195,7 +2418,7 @@ async def _delete202_retry200_initial( _delete202_retry200_initial.metadata = {'url': '/lro/delete/202/retry/200'} @distributed_trace_async - async def delete202_retry200( + async def begin_delete202_retry200( self, **kwargs ) -> "models.Product": @@ -2235,15 +2458,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete202_retry200.metadata = {'url': '/lro/delete/202/retry/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete202_retry200.metadata = {'url': '/lro/delete/202/retry/200'} + + async def delete202_retry200( + self, + **kwargs + ) -> "models.Product": + return await (await self.begin_delete202_retry200( + **kwargs + )) + async def _delete202_no_retry204_initial( self, @@ -2287,7 +2519,7 @@ async def _delete202_no_retry204_initial( _delete202_no_retry204_initial.metadata = {'url': '/lro/delete/202/noretry/204'} @distributed_trace_async - async def delete202_no_retry204( + async def begin_delete202_no_retry204( self, **kwargs ) -> "models.Product": @@ -2327,15 +2559,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete202_no_retry204.metadata = {'url': '/lro/delete/202/noretry/204'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete202_no_retry204.metadata = {'url': '/lro/delete/202/noretry/204'} + + async def delete202_no_retry204( + self, + **kwargs + ) -> "models.Product": + return await (await self.begin_delete202_no_retry204( + **kwargs + )) + async def _delete_no_header_in_retry_initial( self, @@ -2372,7 +2613,7 @@ async def _delete_no_header_in_retry_initial( _delete_no_header_in_retry_initial.metadata = {'url': '/lro/delete/noheader'} @distributed_trace_async - async def delete_no_header_in_retry( + async def begin_delete_no_header_in_retry( self, **kwargs ) -> None: @@ -2409,15 +2650,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_no_header_in_retry.metadata = {'url': '/lro/delete/noheader'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_no_header_in_retry.metadata = {'url': '/lro/delete/noheader'} + + async def delete_no_header_in_retry( + self, + **kwargs + ) -> None: + return await (await self.begin_delete_no_header_in_retry( + **kwargs + )) + async def _delete_async_no_header_in_retry_initial( self, @@ -2454,7 +2704,7 @@ async def _delete_async_no_header_in_retry_initial( _delete_async_no_header_in_retry_initial.metadata = {'url': '/lro/deleteasync/noheader/202/204'} @distributed_trace_async - async def delete_async_no_header_in_retry( + async def begin_delete_async_no_header_in_retry( self, **kwargs ) -> None: @@ -2491,15 +2741,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_async_no_header_in_retry.metadata = {'url': '/lro/deleteasync/noheader/202/204'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_async_no_header_in_retry.metadata = {'url': '/lro/deleteasync/noheader/202/204'} + + async def delete_async_no_header_in_retry( + self, + **kwargs + ) -> None: + return await (await self.begin_delete_async_no_header_in_retry( + **kwargs + )) + async def _delete_async_retry_succeeded_initial( self, @@ -2537,7 +2796,7 @@ async def _delete_async_retry_succeeded_initial( _delete_async_retry_succeeded_initial.metadata = {'url': '/lro/deleteasync/retry/succeeded'} @distributed_trace_async - async def delete_async_retry_succeeded( + async def begin_delete_async_retry_succeeded( self, **kwargs ) -> None: @@ -2574,15 +2833,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_async_retry_succeeded.metadata = {'url': '/lro/deleteasync/retry/succeeded'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_async_retry_succeeded.metadata = {'url': '/lro/deleteasync/retry/succeeded'} + + async def delete_async_retry_succeeded( + self, + **kwargs + ) -> None: + return await (await self.begin_delete_async_retry_succeeded( + **kwargs + )) + async def _delete_async_no_retry_succeeded_initial( self, @@ -2620,7 +2888,7 @@ async def _delete_async_no_retry_succeeded_initial( _delete_async_no_retry_succeeded_initial.metadata = {'url': '/lro/deleteasync/noretry/succeeded'} @distributed_trace_async - async def delete_async_no_retry_succeeded( + async def begin_delete_async_no_retry_succeeded( self, **kwargs ) -> None: @@ -2657,15 +2925,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_async_no_retry_succeeded.metadata = {'url': '/lro/deleteasync/noretry/succeeded'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_async_no_retry_succeeded.metadata = {'url': '/lro/deleteasync/noretry/succeeded'} + + async def delete_async_no_retry_succeeded( + self, + **kwargs + ) -> None: + return await (await self.begin_delete_async_no_retry_succeeded( + **kwargs + )) + async def _delete_async_retry_failed_initial( self, @@ -2703,7 +2980,7 @@ async def _delete_async_retry_failed_initial( _delete_async_retry_failed_initial.metadata = {'url': '/lro/deleteasync/retry/failed'} @distributed_trace_async - async def delete_async_retry_failed( + async def begin_delete_async_retry_failed( self, **kwargs ) -> None: @@ -2740,15 +3017,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_async_retry_failed.metadata = {'url': '/lro/deleteasync/retry/failed'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_async_retry_failed.metadata = {'url': '/lro/deleteasync/retry/failed'} + + async def delete_async_retry_failed( + self, + **kwargs + ) -> None: + return await (await self.begin_delete_async_retry_failed( + **kwargs + )) + async def _delete_async_retrycanceled_initial( self, @@ -2786,7 +3072,7 @@ async def _delete_async_retrycanceled_initial( _delete_async_retrycanceled_initial.metadata = {'url': '/lro/deleteasync/retry/canceled'} @distributed_trace_async - async def delete_async_retrycanceled( + async def begin_delete_async_retrycanceled( self, **kwargs ) -> None: @@ -2823,15 +3109,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_async_retrycanceled.metadata = {'url': '/lro/deleteasync/retry/canceled'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_async_retrycanceled.metadata = {'url': '/lro/deleteasync/retry/canceled'} + + async def delete_async_retrycanceled( + self, + **kwargs + ) -> None: + return await (await self.begin_delete_async_retrycanceled( + **kwargs + )) + async def _post200_with_payload_initial( self, @@ -2873,7 +3168,7 @@ async def _post200_with_payload_initial( _post200_with_payload_initial.metadata = {'url': '/lro/post/payload/200'} @distributed_trace_async - async def post200_with_payload( + async def begin_post200_with_payload( self, **kwargs ) -> "models.Sku": @@ -2913,15 +3208,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post200_with_payload.metadata = {'url': '/lro/post/payload/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post200_with_payload.metadata = {'url': '/lro/post/payload/200'} + + async def post200_with_payload( + self, + **kwargs + ) -> "models.Sku": + return await (await self.begin_post200_with_payload( + **kwargs + )) + async def _post202_retry200_initial( self, @@ -2968,7 +3272,7 @@ async def _post202_retry200_initial( _post202_retry200_initial.metadata = {'url': '/lro/post/202/retry/200'} @distributed_trace_async - async def post202_retry200( + async def begin_post202_retry200( self, product: Optional["models.Product"] = None, **kwargs @@ -3009,15 +3313,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post202_retry200.metadata = {'url': '/lro/post/202/retry/200'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post202_retry200.metadata = {'url': '/lro/post/202/retry/200'} + + async def post202_retry200( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> None: + return await (await self.begin_post202_retry200( + product=product, + **kwargs + )) + async def _post202_no_retry204_initial( self, @@ -3067,7 +3382,7 @@ async def _post202_no_retry204_initial( _post202_no_retry204_initial.metadata = {'url': '/lro/post/202/noretry/204'} @distributed_trace_async - async def post202_no_retry204( + async def begin_post202_no_retry204( self, product: Optional["models.Product"] = None, **kwargs @@ -3115,15 +3430,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post202_no_retry204.metadata = {'url': '/lro/post/202/noretry/204'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post202_no_retry204.metadata = {'url': '/lro/post/202/noretry/204'} + + async def post202_no_retry204( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_post202_no_retry204( + product=product, + **kwargs + )) + async def _post_double_headers_final_location_get_initial( self, @@ -3160,7 +3486,7 @@ async def _post_double_headers_final_location_get_initial( _post_double_headers_final_location_get_initial.metadata = {'url': '/lro/LROPostDoubleHeadersFinalLocationGet'} @distributed_trace_async - async def post_double_headers_final_location_get( + async def begin_post_double_headers_final_location_get( self, **kwargs ) -> "models.Product": @@ -3200,15 +3526,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post_double_headers_final_location_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalLocationGet'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_double_headers_final_location_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalLocationGet'} + + async def post_double_headers_final_location_get( + self, + **kwargs + ) -> "models.Product": + return await (await self.begin_post_double_headers_final_location_get( + **kwargs + )) + async def _post_double_headers_final_azure_header_get_initial( self, @@ -3245,7 +3580,7 @@ async def _post_double_headers_final_azure_header_get_initial( _post_double_headers_final_azure_header_get_initial.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGet'} @distributed_trace_async - async def post_double_headers_final_azure_header_get( + async def begin_post_double_headers_final_azure_header_get( self, **kwargs ) -> "models.Product": @@ -3285,15 +3620,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post_double_headers_final_azure_header_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGet'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_double_headers_final_azure_header_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGet'} + + async def post_double_headers_final_azure_header_get( + self, + **kwargs + ) -> "models.Product": + return await (await self.begin_post_double_headers_final_azure_header_get( + **kwargs + )) + async def _post_double_headers_final_azure_header_get_default_initial( self, @@ -3330,7 +3674,7 @@ async def _post_double_headers_final_azure_header_get_default_initial( _post_double_headers_final_azure_header_get_default_initial.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGetDefault'} @distributed_trace_async - async def post_double_headers_final_azure_header_get_default( + async def begin_post_double_headers_final_azure_header_get_default( self, **kwargs ) -> "models.Product": @@ -3370,15 +3714,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post_double_headers_final_azure_header_get_default.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGetDefault'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_double_headers_final_azure_header_get_default.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGetDefault'} + + async def post_double_headers_final_azure_header_get_default( + self, + **kwargs + ) -> "models.Product": + return await (await self.begin_post_double_headers_final_azure_header_get_default( + **kwargs + )) + async def _post_async_retry_succeeded_initial( self, @@ -3433,7 +3786,7 @@ async def _post_async_retry_succeeded_initial( _post_async_retry_succeeded_initial.metadata = {'url': '/lro/postasync/retry/succeeded'} @distributed_trace_async - async def post_async_retry_succeeded( + async def begin_post_async_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs @@ -3477,15 +3830,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post_async_retry_succeeded.metadata = {'url': '/lro/postasync/retry/succeeded'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_async_retry_succeeded.metadata = {'url': '/lro/postasync/retry/succeeded'} + + async def post_async_retry_succeeded( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_post_async_retry_succeeded( + product=product, + **kwargs + )) + async def _post_async_no_retry_succeeded_initial( self, @@ -3540,7 +3904,7 @@ async def _post_async_no_retry_succeeded_initial( _post_async_no_retry_succeeded_initial.metadata = {'url': '/lro/postasync/noretry/succeeded'} @distributed_trace_async - async def post_async_no_retry_succeeded( + async def begin_post_async_no_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs @@ -3584,15 +3948,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post_async_no_retry_succeeded.metadata = {'url': '/lro/postasync/noretry/succeeded'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_async_no_retry_succeeded.metadata = {'url': '/lro/postasync/noretry/succeeded'} + + async def post_async_no_retry_succeeded( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_post_async_no_retry_succeeded( + product=product, + **kwargs + )) + async def _post_async_retry_failed_initial( self, @@ -3640,7 +4015,7 @@ async def _post_async_retry_failed_initial( _post_async_retry_failed_initial.metadata = {'url': '/lro/postasync/retry/failed'} @distributed_trace_async - async def post_async_retry_failed( + async def begin_post_async_retry_failed( self, product: Optional["models.Product"] = None, **kwargs @@ -3681,15 +4056,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post_async_retry_failed.metadata = {'url': '/lro/postasync/retry/failed'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_async_retry_failed.metadata = {'url': '/lro/postasync/retry/failed'} + + async def post_async_retry_failed( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> None: + return await (await self.begin_post_async_retry_failed( + product=product, + **kwargs + )) + async def _post_async_retrycanceled_initial( self, @@ -3737,7 +4123,7 @@ async def _post_async_retrycanceled_initial( _post_async_retrycanceled_initial.metadata = {'url': '/lro/postasync/retry/canceled'} @distributed_trace_async - async def post_async_retrycanceled( + async def begin_post_async_retrycanceled( self, product: Optional["models.Product"] = None, **kwargs @@ -3778,12 +4164,23 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post_async_retrycanceled.metadata = {'url': '/lro/postasync/retry/canceled'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_async_retrycanceled.metadata = {'url': '/lro/postasync/retry/canceled'} + + async def post_async_retrycanceled( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> None: + return await (await self.begin_post_async_retrycanceled( + product=product, + **kwargs + )) + diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py index 8d5fc896ac9..88c851ce928 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py @@ -11,7 +11,7 @@ from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling @@ -93,7 +93,7 @@ async def _put_non_retry400_initial( _put_non_retry400_initial.metadata = {'url': '/lro/nonretryerror/put/400'} @distributed_trace_async - async def put_non_retry400( + async def begin_put_non_retry400( self, product: Optional["models.Product"] = None, **kwargs @@ -137,15 +137,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_non_retry400.metadata = {'url': '/lro/nonretryerror/put/400'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_non_retry400.metadata = {'url': '/lro/nonretryerror/put/400'} + + async def put_non_retry400( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_non_retry400( + product=product, + **kwargs + )) + async def _put_non_retry201_creating400_initial( self, @@ -197,7 +208,7 @@ async def _put_non_retry201_creating400_initial( _put_non_retry201_creating400_initial.metadata = {'url': '/lro/nonretryerror/put/201/creating/400'} @distributed_trace_async - async def put_non_retry201_creating400( + async def begin_put_non_retry201_creating400( self, product: Optional["models.Product"] = None, **kwargs @@ -241,15 +252,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_non_retry201_creating400.metadata = {'url': '/lro/nonretryerror/put/201/creating/400'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_non_retry201_creating400.metadata = {'url': '/lro/nonretryerror/put/201/creating/400'} + + async def put_non_retry201_creating400( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_non_retry201_creating400( + product=product, + **kwargs + )) + async def _put_non_retry201_creating400_invalid_json_initial( self, @@ -301,7 +323,7 @@ async def _put_non_retry201_creating400_invalid_json_initial( _put_non_retry201_creating400_invalid_json_initial.metadata = {'url': '/lro/nonretryerror/put/201/creating/400/invalidjson'} @distributed_trace_async - async def put_non_retry201_creating400_invalid_json( + async def begin_put_non_retry201_creating400_invalid_json( self, product: Optional["models.Product"] = None, **kwargs @@ -345,15 +367,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_non_retry201_creating400_invalid_json.metadata = {'url': '/lro/nonretryerror/put/201/creating/400/invalidjson'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_non_retry201_creating400_invalid_json.metadata = {'url': '/lro/nonretryerror/put/201/creating/400/invalidjson'} + + async def put_non_retry201_creating400_invalid_json( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_non_retry201_creating400_invalid_json( + product=product, + **kwargs + )) + async def _put_async_relative_retry400_initial( self, @@ -404,7 +437,7 @@ async def _put_async_relative_retry400_initial( _put_async_relative_retry400_initial.metadata = {'url': '/lro/nonretryerror/putasync/retry/400'} @distributed_trace_async - async def put_async_relative_retry400( + async def begin_put_async_relative_retry400( self, product: Optional["models.Product"] = None, **kwargs @@ -453,15 +486,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/putasync/retry/400'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/putasync/retry/400'} + + async def put_async_relative_retry400( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_async_relative_retry400( + product=product, + **kwargs + )) + async def _delete_non_retry400_initial( self, @@ -498,7 +542,7 @@ async def _delete_non_retry400_initial( _delete_non_retry400_initial.metadata = {'url': '/lro/nonretryerror/delete/400'} @distributed_trace_async - async def delete_non_retry400( + async def begin_delete_non_retry400( self, **kwargs ) -> None: @@ -535,15 +579,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/400'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/400'} + + async def delete_non_retry400( + self, + **kwargs + ) -> None: + return await (await self.begin_delete_non_retry400( + **kwargs + )) + async def _delete202_non_retry400_initial( self, @@ -580,7 +633,7 @@ async def _delete202_non_retry400_initial( _delete202_non_retry400_initial.metadata = {'url': '/lro/nonretryerror/delete/202/retry/400'} @distributed_trace_async - async def delete202_non_retry400( + async def begin_delete202_non_retry400( self, **kwargs ) -> None: @@ -617,15 +670,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete202_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/202/retry/400'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete202_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/202/retry/400'} + + async def delete202_non_retry400( + self, + **kwargs + ) -> None: + return await (await self.begin_delete202_non_retry400( + **kwargs + )) + async def _delete_async_relative_retry400_initial( self, @@ -663,7 +725,7 @@ async def _delete_async_relative_retry400_initial( _delete_async_relative_retry400_initial.metadata = {'url': '/lro/nonretryerror/deleteasync/retry/400'} @distributed_trace_async - async def delete_async_relative_retry400( + async def begin_delete_async_relative_retry400( self, **kwargs ) -> None: @@ -700,15 +762,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/deleteasync/retry/400'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/deleteasync/retry/400'} + + async def delete_async_relative_retry400( + self, + **kwargs + ) -> None: + return await (await self.begin_delete_async_relative_retry400( + **kwargs + )) + async def _post_non_retry400_initial( self, @@ -755,7 +826,7 @@ async def _post_non_retry400_initial( _post_non_retry400_initial.metadata = {'url': '/lro/nonretryerror/post/400'} @distributed_trace_async - async def post_non_retry400( + async def begin_post_non_retry400( self, product: Optional["models.Product"] = None, **kwargs @@ -796,15 +867,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post_non_retry400.metadata = {'url': '/lro/nonretryerror/post/400'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_non_retry400.metadata = {'url': '/lro/nonretryerror/post/400'} + + async def post_non_retry400( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> None: + return await (await self.begin_post_non_retry400( + product=product, + **kwargs + )) + async def _post202_non_retry400_initial( self, @@ -851,7 +933,7 @@ async def _post202_non_retry400_initial( _post202_non_retry400_initial.metadata = {'url': '/lro/nonretryerror/post/202/retry/400'} @distributed_trace_async - async def post202_non_retry400( + async def begin_post202_non_retry400( self, product: Optional["models.Product"] = None, **kwargs @@ -892,15 +974,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post202_non_retry400.metadata = {'url': '/lro/nonretryerror/post/202/retry/400'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post202_non_retry400.metadata = {'url': '/lro/nonretryerror/post/202/retry/400'} + + async def post202_non_retry400( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> None: + return await (await self.begin_post202_non_retry400( + product=product, + **kwargs + )) + async def _post_async_relative_retry400_initial( self, @@ -948,7 +1041,7 @@ async def _post_async_relative_retry400_initial( _post_async_relative_retry400_initial.metadata = {'url': '/lro/nonretryerror/postasync/retry/400'} @distributed_trace_async - async def post_async_relative_retry400( + async def begin_post_async_relative_retry400( self, product: Optional["models.Product"] = None, **kwargs @@ -989,15 +1082,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/postasync/retry/400'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/postasync/retry/400'} + + async def post_async_relative_retry400( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> None: + return await (await self.begin_post_async_relative_retry400( + product=product, + **kwargs + )) + async def _put_error201_no_provisioning_state_payload_initial( self, @@ -1049,7 +1153,7 @@ async def _put_error201_no_provisioning_state_payload_initial( _put_error201_no_provisioning_state_payload_initial.metadata = {'url': '/lro/error/put/201/noprovisioningstatepayload'} @distributed_trace_async - async def put_error201_no_provisioning_state_payload( + async def begin_put_error201_no_provisioning_state_payload( self, product: Optional["models.Product"] = None, **kwargs @@ -1093,15 +1197,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_error201_no_provisioning_state_payload.metadata = {'url': '/lro/error/put/201/noprovisioningstatepayload'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_error201_no_provisioning_state_payload.metadata = {'url': '/lro/error/put/201/noprovisioningstatepayload'} + + async def put_error201_no_provisioning_state_payload( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_error201_no_provisioning_state_payload( + product=product, + **kwargs + )) + async def _put_async_relative_retry_no_status_initial( self, @@ -1152,7 +1267,7 @@ async def _put_async_relative_retry_no_status_initial( _put_async_relative_retry_no_status_initial.metadata = {'url': '/lro/error/putasync/retry/nostatus'} @distributed_trace_async - async def put_async_relative_retry_no_status( + async def begin_put_async_relative_retry_no_status( self, product: Optional["models.Product"] = None, **kwargs @@ -1201,15 +1316,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_async_relative_retry_no_status.metadata = {'url': '/lro/error/putasync/retry/nostatus'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_async_relative_retry_no_status.metadata = {'url': '/lro/error/putasync/retry/nostatus'} + + async def put_async_relative_retry_no_status( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_async_relative_retry_no_status( + product=product, + **kwargs + )) + async def _put_async_relative_retry_no_status_payload_initial( self, @@ -1260,7 +1386,7 @@ async def _put_async_relative_retry_no_status_payload_initial( _put_async_relative_retry_no_status_payload_initial.metadata = {'url': '/lro/error/putasync/retry/nostatuspayload'} @distributed_trace_async - async def put_async_relative_retry_no_status_payload( + async def begin_put_async_relative_retry_no_status_payload( self, product: Optional["models.Product"] = None, **kwargs @@ -1309,15 +1435,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_async_relative_retry_no_status_payload.metadata = {'url': '/lro/error/putasync/retry/nostatuspayload'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_async_relative_retry_no_status_payload.metadata = {'url': '/lro/error/putasync/retry/nostatuspayload'} + + async def put_async_relative_retry_no_status_payload( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_async_relative_retry_no_status_payload( + product=product, + **kwargs + )) + async def _delete204_succeeded_initial( self, @@ -1350,7 +1487,7 @@ async def _delete204_succeeded_initial( _delete204_succeeded_initial.metadata = {'url': '/lro/error/delete/204/nolocation'} @distributed_trace_async - async def delete204_succeeded( + async def begin_delete204_succeeded( self, **kwargs ) -> None: @@ -1387,15 +1524,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete204_succeeded.metadata = {'url': '/lro/error/delete/204/nolocation'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete204_succeeded.metadata = {'url': '/lro/error/delete/204/nolocation'} + + async def delete204_succeeded( + self, + **kwargs + ) -> None: + return await (await self.begin_delete204_succeeded( + **kwargs + )) + async def _delete_async_relative_retry_no_status_initial( self, @@ -1433,7 +1579,7 @@ async def _delete_async_relative_retry_no_status_initial( _delete_async_relative_retry_no_status_initial.metadata = {'url': '/lro/error/deleteasync/retry/nostatus'} @distributed_trace_async - async def delete_async_relative_retry_no_status( + async def begin_delete_async_relative_retry_no_status( self, **kwargs ) -> None: @@ -1470,15 +1616,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_async_relative_retry_no_status.metadata = {'url': '/lro/error/deleteasync/retry/nostatus'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_async_relative_retry_no_status.metadata = {'url': '/lro/error/deleteasync/retry/nostatus'} + + async def delete_async_relative_retry_no_status( + self, + **kwargs + ) -> None: + return await (await self.begin_delete_async_relative_retry_no_status( + **kwargs + )) + async def _post202_no_location_initial( self, @@ -1525,7 +1680,7 @@ async def _post202_no_location_initial( _post202_no_location_initial.metadata = {'url': '/lro/error/post/202/nolocation'} @distributed_trace_async - async def post202_no_location( + async def begin_post202_no_location( self, product: Optional["models.Product"] = None, **kwargs @@ -1566,15 +1721,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post202_no_location.metadata = {'url': '/lro/error/post/202/nolocation'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post202_no_location.metadata = {'url': '/lro/error/post/202/nolocation'} + + async def post202_no_location( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> None: + return await (await self.begin_post202_no_location( + product=product, + **kwargs + )) + async def _post_async_relative_retry_no_payload_initial( self, @@ -1622,7 +1788,7 @@ async def _post_async_relative_retry_no_payload_initial( _post_async_relative_retry_no_payload_initial.metadata = {'url': '/lro/error/postasync/retry/nopayload'} @distributed_trace_async - async def post_async_relative_retry_no_payload( + async def begin_post_async_relative_retry_no_payload( self, product: Optional["models.Product"] = None, **kwargs @@ -1663,15 +1829,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post_async_relative_retry_no_payload.metadata = {'url': '/lro/error/postasync/retry/nopayload'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_async_relative_retry_no_payload.metadata = {'url': '/lro/error/postasync/retry/nopayload'} + + async def post_async_relative_retry_no_payload( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> None: + return await (await self.begin_post_async_relative_retry_no_payload( + product=product, + **kwargs + )) + async def _put200_invalid_json_initial( self, @@ -1720,7 +1897,7 @@ async def _put200_invalid_json_initial( _put200_invalid_json_initial.metadata = {'url': '/lro/error/put/200/invalidjson'} @distributed_trace_async - async def put200_invalid_json( + async def begin_put200_invalid_json( self, product: Optional["models.Product"] = None, **kwargs @@ -1764,15 +1941,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put200_invalid_json.metadata = {'url': '/lro/error/put/200/invalidjson'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put200_invalid_json.metadata = {'url': '/lro/error/put/200/invalidjson'} + + async def put200_invalid_json( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put200_invalid_json( + product=product, + **kwargs + )) + async def _put_async_relative_retry_invalid_header_initial( self, @@ -1823,7 +2011,7 @@ async def _put_async_relative_retry_invalid_header_initial( _put_async_relative_retry_invalid_header_initial.metadata = {'url': '/lro/error/putasync/retry/invalidheader'} @distributed_trace_async - async def put_async_relative_retry_invalid_header( + async def begin_put_async_relative_retry_invalid_header( self, product: Optional["models.Product"] = None, **kwargs @@ -1872,15 +2060,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/putasync/retry/invalidheader'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/putasync/retry/invalidheader'} + + async def put_async_relative_retry_invalid_header( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_async_relative_retry_invalid_header( + product=product, + **kwargs + )) + async def _put_async_relative_retry_invalid_json_polling_initial( self, @@ -1931,7 +2130,7 @@ async def _put_async_relative_retry_invalid_json_polling_initial( _put_async_relative_retry_invalid_json_polling_initial.metadata = {'url': '/lro/error/putasync/retry/invalidjsonpolling'} @distributed_trace_async - async def put_async_relative_retry_invalid_json_polling( + async def begin_put_async_relative_retry_invalid_json_polling( self, product: Optional["models.Product"] = None, **kwargs @@ -1980,15 +2179,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - put_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/putasync/retry/invalidjsonpolling'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_put_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/putasync/retry/invalidjsonpolling'} + + async def put_async_relative_retry_invalid_json_polling( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> "models.Product": + return await (await self.begin_put_async_relative_retry_invalid_json_polling( + product=product, + **kwargs + )) + async def _delete202_retry_invalid_header_initial( self, @@ -2025,7 +2235,7 @@ async def _delete202_retry_invalid_header_initial( _delete202_retry_invalid_header_initial.metadata = {'url': '/lro/error/delete/202/retry/invalidheader'} @distributed_trace_async - async def delete202_retry_invalid_header( + async def begin_delete202_retry_invalid_header( self, **kwargs ) -> None: @@ -2062,15 +2272,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete202_retry_invalid_header.metadata = {'url': '/lro/error/delete/202/retry/invalidheader'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete202_retry_invalid_header.metadata = {'url': '/lro/error/delete/202/retry/invalidheader'} + + async def delete202_retry_invalid_header( + self, + **kwargs + ) -> None: + return await (await self.begin_delete202_retry_invalid_header( + **kwargs + )) + async def _delete_async_relative_retry_invalid_header_initial( self, @@ -2108,7 +2327,7 @@ async def _delete_async_relative_retry_invalid_header_initial( _delete_async_relative_retry_invalid_header_initial.metadata = {'url': '/lro/error/deleteasync/retry/invalidheader'} @distributed_trace_async - async def delete_async_relative_retry_invalid_header( + async def begin_delete_async_relative_retry_invalid_header( self, **kwargs ) -> None: @@ -2145,15 +2364,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/deleteasync/retry/invalidheader'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/deleteasync/retry/invalidheader'} + + async def delete_async_relative_retry_invalid_header( + self, + **kwargs + ) -> None: + return await (await self.begin_delete_async_relative_retry_invalid_header( + **kwargs + )) + async def _delete_async_relative_retry_invalid_json_polling_initial( self, @@ -2191,7 +2419,7 @@ async def _delete_async_relative_retry_invalid_json_polling_initial( _delete_async_relative_retry_invalid_json_polling_initial.metadata = {'url': '/lro/error/deleteasync/retry/invalidjsonpolling'} @distributed_trace_async - async def delete_async_relative_retry_invalid_json_polling( + async def begin_delete_async_relative_retry_invalid_json_polling( self, **kwargs ) -> None: @@ -2228,15 +2456,24 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - delete_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/deleteasync/retry/invalidjsonpolling'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/deleteasync/retry/invalidjsonpolling'} + + async def delete_async_relative_retry_invalid_json_polling( + self, + **kwargs + ) -> None: + return await (await self.begin_delete_async_relative_retry_invalid_json_polling( + **kwargs + )) + async def _post202_retry_invalid_header_initial( self, @@ -2283,7 +2520,7 @@ async def _post202_retry_invalid_header_initial( _post202_retry_invalid_header_initial.metadata = {'url': '/lro/error/post/202/retry/invalidheader'} @distributed_trace_async - async def post202_retry_invalid_header( + async def begin_post202_retry_invalid_header( self, product: Optional["models.Product"] = None, **kwargs @@ -2324,15 +2561,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post202_retry_invalid_header.metadata = {'url': '/lro/error/post/202/retry/invalidheader'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post202_retry_invalid_header.metadata = {'url': '/lro/error/post/202/retry/invalidheader'} + + async def post202_retry_invalid_header( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> None: + return await (await self.begin_post202_retry_invalid_header( + product=product, + **kwargs + )) + async def _post_async_relative_retry_invalid_header_initial( self, @@ -2380,7 +2628,7 @@ async def _post_async_relative_retry_invalid_header_initial( _post_async_relative_retry_invalid_header_initial.metadata = {'url': '/lro/error/postasync/retry/invalidheader'} @distributed_trace_async - async def post_async_relative_retry_invalid_header( + async def begin_post_async_relative_retry_invalid_header( self, product: Optional["models.Product"] = None, **kwargs @@ -2421,15 +2669,26 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/postasync/retry/invalidheader'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/postasync/retry/invalidheader'} + + async def post_async_relative_retry_invalid_header( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> None: + return await (await self.begin_post_async_relative_retry_invalid_header( + product=product, + **kwargs + )) + async def _post_async_relative_retry_invalid_json_polling_initial( self, @@ -2477,7 +2736,7 @@ async def _post_async_relative_retry_invalid_json_polling_initial( _post_async_relative_retry_invalid_json_polling_initial.metadata = {'url': '/lro/error/postasync/retry/invalidjsonpolling'} @distributed_trace_async - async def post_async_relative_retry_invalid_json_polling( + async def begin_post_async_relative_retry_invalid_json_polling( self, product: Optional["models.Product"] = None, **kwargs @@ -2518,12 +2777,23 @@ def get_long_running_output(pipeline_response): elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: - return await async_poller.from_continuation_token( + return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output ) else: - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - post_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/postasync/retry/invalidjsonpolling'} + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_post_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/postasync/retry/invalidjsonpolling'} + + async def post_async_relative_retry_invalid_json_polling( + self, + product: Optional["models.Product"] = None, + **kwargs + ) -> None: + return await (await self.begin_post_async_relative_retry_invalid_json_polling( + product=product, + **kwargs + )) + diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py index 02cfe9ca23e..409be683999 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py @@ -157,6 +157,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_succeeded.metadata = {'url': '/lro/customheader/putasync/retry/succeeded'} + def put_async_retry_succeeded( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_async_retry_succeeded( + product=product, + **kwargs + ).result() + + def _put201_creating_succeeded200_initial( self, product=None, # type: Optional["models.Product"] @@ -263,6 +275,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/customheader/put/201/creating/succeeded/200'} + def put201_creating_succeeded200( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put201_creating_succeeded200( + product=product, + **kwargs + ).result() + + def _post202_retry200_initial( self, product=None, # type: Optional["models.Product"] @@ -361,6 +385,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/customheader/post/202/retry/200'} + def post202_retry200( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_post202_retry200( + product=product, + **kwargs + ).result() + + def _post_async_retry_succeeded_initial( self, product=None, # type: Optional["models.Product"] @@ -459,3 +495,15 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_succeeded.metadata = {'url': '/lro/customheader/postasync/retry/succeeded'} + + def post_async_retry_succeeded( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_post_async_retry_succeeded( + product=product, + **kwargs + ).result() + diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py index 2d2a8b3b1eb..417e7823569 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py @@ -153,6 +153,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/retryerror/put/201/creating/succeeded/200'} + def put201_creating_succeeded200( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put201_creating_succeeded200( + product=product, + **kwargs + ).result() + + def _put_async_relative_retry_succeeded_initial( self, product=None, # type: Optional["models.Product"] @@ -263,6 +275,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/putasync/retry/succeeded'} + def put_async_relative_retry_succeeded( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_async_relative_retry_succeeded( + product=product, + **kwargs + ).result() + + def _delete_provisioning202_accepted200_succeeded_initial( self, **kwargs # type: Any @@ -362,6 +386,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/retryerror/delete/provisioning/202/accepted/200/succeeded'} + def delete_provisioning202_accepted200_succeeded( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_delete_provisioning202_accepted200_succeeded( + **kwargs + ).result() + + def _delete202_retry200_initial( self, **kwargs # type: Any @@ -446,6 +480,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry200.metadata = {'url': '/lro/retryerror/delete/202/retry/200'} + def delete202_retry200( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete202_retry200( + **kwargs + ).result() + + def _delete_async_relative_retry_succeeded_initial( self, **kwargs # type: Any @@ -531,6 +575,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/deleteasync/retry/succeeded'} + def delete_async_relative_retry_succeeded( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete_async_relative_retry_succeeded( + **kwargs + ).result() + + def _post202_retry200_initial( self, product=None, # type: Optional["models.Product"] @@ -629,6 +683,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/retryerror/post/202/retry/200'} + def post202_retry200( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_post202_retry200( + product=product, + **kwargs + ).result() + + def _post_async_relative_retry_succeeded_initial( self, product=None, # type: Optional["models.Product"] @@ -727,3 +793,15 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/postasync/retry/succeeded'} + + def post_async_relative_retry_succeeded( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_post_async_relative_retry_succeeded( + product=product, + **kwargs + ).result() + diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py index 0adeddc79cb..0e1da963c2d 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py @@ -150,6 +150,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_succeeded.metadata = {'url': '/lro/put/200/succeeded'} + def put200_succeeded( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put200_succeeded( + product=product, + **kwargs + ).result() + + def _put200_succeeded_no_state_initial( self, product=None, # type: Optional["models.Product"] @@ -251,6 +263,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_succeeded_no_state.metadata = {'url': '/lro/put/200/succeeded/nostate'} + def put200_succeeded_no_state( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put200_succeeded_no_state( + product=product, + **kwargs + ).result() + + def _put202_retry200_initial( self, product=None, # type: Optional["models.Product"] @@ -352,6 +376,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put202_retry200.metadata = {'url': '/lro/put/202/retry/200'} + def put202_retry200( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put202_retry200( + product=product, + **kwargs + ).result() + + def _put201_creating_succeeded200_initial( self, product=None, # type: Optional["models.Product"] @@ -458,6 +494,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/put/201/creating/succeeded/200'} + def put201_creating_succeeded200( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put201_creating_succeeded200( + product=product, + **kwargs + ).result() + + def _put200_updating_succeeded204_initial( self, product=None, # type: Optional["models.Product"] @@ -559,6 +607,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_updating_succeeded204.metadata = {'url': '/lro/put/200/updating/succeeded/200'} + def put200_updating_succeeded204( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put200_updating_succeeded204( + product=product, + **kwargs + ).result() + + def _put201_creating_failed200_initial( self, product=None, # type: Optional["models.Product"] @@ -665,6 +725,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_failed200.metadata = {'url': '/lro/put/201/created/failed/200'} + def put201_creating_failed200( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put201_creating_failed200( + product=product, + **kwargs + ).result() + + def _put200_acceptedcanceled200_initial( self, product=None, # type: Optional["models.Product"] @@ -766,6 +838,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_acceptedcanceled200.metadata = {'url': '/lro/put/200/accepted/canceled/200'} + def put200_acceptedcanceled200( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put200_acceptedcanceled200( + product=product, + **kwargs + ).result() + + def _put_no_header_in_retry_initial( self, product=None, # type: Optional["models.Product"] @@ -872,6 +956,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_no_header_in_retry.metadata = {'url': '/lro/put/noheader/202/200'} + def put_no_header_in_retry( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_no_header_in_retry( + product=product, + **kwargs + ).result() + + def _put_async_retry_succeeded_initial( self, product=None, # type: Optional["models.Product"] @@ -982,6 +1078,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_succeeded.metadata = {'url': '/lro/putasync/retry/succeeded'} + def put_async_retry_succeeded( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_async_retry_succeeded( + product=product, + **kwargs + ).result() + + def _put_async_no_retry_succeeded_initial( self, product=None, # type: Optional["models.Product"] @@ -1090,6 +1198,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_retry_succeeded.metadata = {'url': '/lro/putasync/noretry/succeeded'} + def put_async_no_retry_succeeded( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_async_no_retry_succeeded( + product=product, + **kwargs + ).result() + + def _put_async_retry_failed_initial( self, product=None, # type: Optional["models.Product"] @@ -1200,6 +1320,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_failed.metadata = {'url': '/lro/putasync/retry/failed'} + def put_async_retry_failed( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_async_retry_failed( + product=product, + **kwargs + ).result() + + def _put_async_no_retrycanceled_initial( self, product=None, # type: Optional["models.Product"] @@ -1308,6 +1440,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_retrycanceled.metadata = {'url': '/lro/putasync/noretry/canceled'} + def put_async_no_retrycanceled( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_async_no_retrycanceled( + product=product, + **kwargs + ).result() + + def _put_async_no_header_in_retry_initial( self, product=None, # type: Optional["models.Product"] @@ -1414,6 +1558,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_header_in_retry.metadata = {'url': '/lro/putasync/noheader/201/200'} + def put_async_no_header_in_retry( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_async_no_header_in_retry( + product=product, + **kwargs + ).result() + + def _put_non_resource_initial( self, sku=None, # type: Optional["models.Sku"] @@ -1515,6 +1671,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_resource.metadata = {'url': '/lro/putnonresource/202/200'} + def put_non_resource( + self, + sku=None, # type: Optional["models.Sku"] + **kwargs # type: Any + ): + # type: (...) -> "models.Sku" + return self.begin_put_non_resource( + sku=sku, + **kwargs + ).result() + + def _put_async_non_resource_initial( self, sku=None, # type: Optional["models.Sku"] @@ -1616,6 +1784,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_non_resource.metadata = {'url': '/lro/putnonresourceasync/202/200'} + def put_async_non_resource( + self, + sku=None, # type: Optional["models.Sku"] + **kwargs # type: Any + ): + # type: (...) -> "models.Sku" + return self.begin_put_async_non_resource( + sku=sku, + **kwargs + ).result() + + def _put_sub_resource_initial( self, provisioning_state=None, # type: Optional[str] @@ -1719,6 +1899,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_sub_resource.metadata = {'url': '/lro/putsubresource/202/200'} + def put_sub_resource( + self, + provisioning_state=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SubProduct" + return self.begin_put_sub_resource( + provisioning_state=provisioning_state, + **kwargs + ).result() + + def _put_async_sub_resource_initial( self, provisioning_state=None, # type: Optional[str] @@ -1822,6 +2014,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_sub_resource.metadata = {'url': '/lro/putsubresourceasync/202/200'} + def put_async_sub_resource( + self, + provisioning_state=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "models.SubProduct" + return self.begin_put_async_sub_resource( + provisioning_state=provisioning_state, + **kwargs + ).result() + + def _delete_provisioning202_accepted200_succeeded_initial( self, **kwargs # type: Any @@ -1921,6 +2125,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/delete/provisioning/202/accepted/200/succeeded'} + def delete_provisioning202_accepted200_succeeded( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_delete_provisioning202_accepted200_succeeded( + **kwargs + ).result() + + def _delete_provisioning202_deleting_failed200_initial( self, **kwargs # type: Any @@ -2020,6 +2234,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_deleting_failed200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/failed'} + def delete_provisioning202_deleting_failed200( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_delete_provisioning202_deleting_failed200( + **kwargs + ).result() + + def _delete_provisioning202_deletingcanceled200_initial( self, **kwargs # type: Any @@ -2119,6 +2343,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_deletingcanceled200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/canceled'} + def delete_provisioning202_deletingcanceled200( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_delete_provisioning202_deletingcanceled200( + **kwargs + ).result() + + def _delete204_succeeded_initial( self, **kwargs # type: Any @@ -2199,6 +2433,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete204_succeeded.metadata = {'url': '/lro/delete/204/succeeded'} + def delete204_succeeded( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete204_succeeded( + **kwargs + ).result() + + def _delete202_retry200_initial( self, **kwargs # type: Any @@ -2293,6 +2537,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry200.metadata = {'url': '/lro/delete/202/retry/200'} + def delete202_retry200( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_delete202_retry200( + **kwargs + ).result() + + def _delete202_no_retry204_initial( self, **kwargs # type: Any @@ -2387,6 +2641,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_no_retry204.metadata = {'url': '/lro/delete/202/noretry/204'} + def delete202_no_retry204( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_delete202_no_retry204( + **kwargs + ).result() + + def _delete_no_header_in_retry_initial( self, **kwargs # type: Any @@ -2471,6 +2735,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_no_header_in_retry.metadata = {'url': '/lro/delete/noheader'} + def delete_no_header_in_retry( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete_no_header_in_retry( + **kwargs + ).result() + + def _delete_async_no_header_in_retry_initial( self, **kwargs # type: Any @@ -2555,6 +2829,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_no_header_in_retry.metadata = {'url': '/lro/deleteasync/noheader/202/204'} + def delete_async_no_header_in_retry( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete_async_no_header_in_retry( + **kwargs + ).result() + + def _delete_async_retry_succeeded_initial( self, **kwargs # type: Any @@ -2640,6 +2924,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retry_succeeded.metadata = {'url': '/lro/deleteasync/retry/succeeded'} + def delete_async_retry_succeeded( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete_async_retry_succeeded( + **kwargs + ).result() + + def _delete_async_no_retry_succeeded_initial( self, **kwargs # type: Any @@ -2725,6 +3019,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_no_retry_succeeded.metadata = {'url': '/lro/deleteasync/noretry/succeeded'} + def delete_async_no_retry_succeeded( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete_async_no_retry_succeeded( + **kwargs + ).result() + + def _delete_async_retry_failed_initial( self, **kwargs # type: Any @@ -2810,6 +3114,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retry_failed.metadata = {'url': '/lro/deleteasync/retry/failed'} + def delete_async_retry_failed( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete_async_retry_failed( + **kwargs + ).result() + + def _delete_async_retrycanceled_initial( self, **kwargs # type: Any @@ -2895,6 +3209,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retrycanceled.metadata = {'url': '/lro/deleteasync/retry/canceled'} + def delete_async_retrycanceled( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete_async_retrycanceled( + **kwargs + ).result() + + def _post200_with_payload_initial( self, **kwargs # type: Any @@ -2987,6 +3311,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post200_with_payload.metadata = {'url': '/lro/post/payload/200'} + def post200_with_payload( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.Sku" + return self.begin_post200_with_payload( + **kwargs + ).result() + + def _post202_retry200_initial( self, product=None, # type: Optional["models.Product"] @@ -3085,6 +3419,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/post/202/retry/200'} + def post202_retry200( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_post202_retry200( + product=product, + **kwargs + ).result() + + def _post202_no_retry204_initial( self, product=None, # type: Optional["models.Product"] @@ -3193,6 +3539,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_no_retry204.metadata = {'url': '/lro/post/202/noretry/204'} + def post202_no_retry204( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_post202_no_retry204( + product=product, + **kwargs + ).result() + + def _post_double_headers_final_location_get_initial( self, **kwargs # type: Any @@ -3280,6 +3638,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_location_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalLocationGet'} + def post_double_headers_final_location_get( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_post_double_headers_final_location_get( + **kwargs + ).result() + + def _post_double_headers_final_azure_header_get_initial( self, **kwargs # type: Any @@ -3367,6 +3735,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_azure_header_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGet'} + def post_double_headers_final_azure_header_get( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_post_double_headers_final_azure_header_get( + **kwargs + ).result() + + def _post_double_headers_final_azure_header_get_default_initial( self, **kwargs # type: Any @@ -3454,6 +3832,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_azure_header_get_default.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGetDefault'} + def post_double_headers_final_azure_header_get_default( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_post_double_headers_final_azure_header_get_default( + **kwargs + ).result() + + def _post_async_retry_succeeded_initial( self, product=None, # type: Optional["models.Product"] @@ -3563,6 +3951,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_succeeded.metadata = {'url': '/lro/postasync/retry/succeeded'} + def post_async_retry_succeeded( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_post_async_retry_succeeded( + product=product, + **kwargs + ).result() + + def _post_async_no_retry_succeeded_initial( self, product=None, # type: Optional["models.Product"] @@ -3672,6 +4072,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_no_retry_succeeded.metadata = {'url': '/lro/postasync/noretry/succeeded'} + def post_async_no_retry_succeeded( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_post_async_no_retry_succeeded( + product=product, + **kwargs + ).result() + + def _post_async_retry_failed_initial( self, product=None, # type: Optional["models.Product"] @@ -3771,6 +4183,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_failed.metadata = {'url': '/lro/postasync/retry/failed'} + def post_async_retry_failed( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_post_async_retry_failed( + product=product, + **kwargs + ).result() + + def _post_async_retrycanceled_initial( self, product=None, # type: Optional["models.Product"] @@ -3869,3 +4293,15 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retrycanceled.metadata = {'url': '/lro/postasync/retry/canceled'} + + def post_async_retrycanceled( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_post_async_retrycanceled( + product=product, + **kwargs + ).result() + diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py index 3098b110a3c..317b0e0a736 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py @@ -153,6 +153,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry400.metadata = {'url': '/lro/nonretryerror/put/400'} + def put_non_retry400( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_non_retry400( + product=product, + **kwargs + ).result() + + def _put_non_retry201_creating400_initial( self, product=None, # type: Optional["models.Product"] @@ -259,6 +271,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry201_creating400.metadata = {'url': '/lro/nonretryerror/put/201/creating/400'} + def put_non_retry201_creating400( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_non_retry201_creating400( + product=product, + **kwargs + ).result() + + def _put_non_retry201_creating400_invalid_json_initial( self, product=None, # type: Optional["models.Product"] @@ -365,6 +389,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry201_creating400_invalid_json.metadata = {'url': '/lro/nonretryerror/put/201/creating/400/invalidjson'} + def put_non_retry201_creating400_invalid_json( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_non_retry201_creating400_invalid_json( + product=product, + **kwargs + ).result() + + def _put_async_relative_retry400_initial( self, product=None, # type: Optional["models.Product"] @@ -475,6 +511,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/putasync/retry/400'} + def put_async_relative_retry400( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_async_relative_retry400( + product=product, + **kwargs + ).result() + + def _delete_non_retry400_initial( self, **kwargs # type: Any @@ -559,6 +607,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/400'} + def delete_non_retry400( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete_non_retry400( + **kwargs + ).result() + + def _delete202_non_retry400_initial( self, **kwargs # type: Any @@ -643,6 +701,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/202/retry/400'} + def delete202_non_retry400( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete202_non_retry400( + **kwargs + ).result() + + def _delete_async_relative_retry400_initial( self, **kwargs # type: Any @@ -728,6 +796,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/deleteasync/retry/400'} + def delete_async_relative_retry400( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete_async_relative_retry400( + **kwargs + ).result() + + def _post_non_retry400_initial( self, product=None, # type: Optional["models.Product"] @@ -826,6 +904,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_non_retry400.metadata = {'url': '/lro/nonretryerror/post/400'} + def post_non_retry400( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_post_non_retry400( + product=product, + **kwargs + ).result() + + def _post202_non_retry400_initial( self, product=None, # type: Optional["models.Product"] @@ -924,6 +1014,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_non_retry400.metadata = {'url': '/lro/nonretryerror/post/202/retry/400'} + def post202_non_retry400( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_post202_non_retry400( + product=product, + **kwargs + ).result() + + def _post_async_relative_retry400_initial( self, product=None, # type: Optional["models.Product"] @@ -1023,6 +1125,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/postasync/retry/400'} + def post_async_relative_retry400( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_post_async_relative_retry400( + product=product, + **kwargs + ).result() + + def _put_error201_no_provisioning_state_payload_initial( self, product=None, # type: Optional["models.Product"] @@ -1129,6 +1243,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_error201_no_provisioning_state_payload.metadata = {'url': '/lro/error/put/201/noprovisioningstatepayload'} + def put_error201_no_provisioning_state_payload( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_error201_no_provisioning_state_payload( + product=product, + **kwargs + ).result() + + def _put_async_relative_retry_no_status_initial( self, product=None, # type: Optional["models.Product"] @@ -1239,6 +1365,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_no_status.metadata = {'url': '/lro/error/putasync/retry/nostatus'} + def put_async_relative_retry_no_status( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_async_relative_retry_no_status( + product=product, + **kwargs + ).result() + + def _put_async_relative_retry_no_status_payload_initial( self, product=None, # type: Optional["models.Product"] @@ -1349,6 +1487,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_no_status_payload.metadata = {'url': '/lro/error/putasync/retry/nostatuspayload'} + def put_async_relative_retry_no_status_payload( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_async_relative_retry_no_status_payload( + product=product, + **kwargs + ).result() + + def _delete204_succeeded_initial( self, **kwargs # type: Any @@ -1429,6 +1579,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete204_succeeded.metadata = {'url': '/lro/error/delete/204/nolocation'} + def delete204_succeeded( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete204_succeeded( + **kwargs + ).result() + + def _delete_async_relative_retry_no_status_initial( self, **kwargs # type: Any @@ -1514,6 +1674,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_no_status.metadata = {'url': '/lro/error/deleteasync/retry/nostatus'} + def delete_async_relative_retry_no_status( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete_async_relative_retry_no_status( + **kwargs + ).result() + + def _post202_no_location_initial( self, product=None, # type: Optional["models.Product"] @@ -1612,6 +1782,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_no_location.metadata = {'url': '/lro/error/post/202/nolocation'} + def post202_no_location( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_post202_no_location( + product=product, + **kwargs + ).result() + + def _post_async_relative_retry_no_payload_initial( self, product=None, # type: Optional["models.Product"] @@ -1711,6 +1893,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_no_payload.metadata = {'url': '/lro/error/postasync/retry/nopayload'} + def post_async_relative_retry_no_payload( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_post_async_relative_retry_no_payload( + product=product, + **kwargs + ).result() + + def _put200_invalid_json_initial( self, product=None, # type: Optional["models.Product"] @@ -1814,6 +2008,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_invalid_json.metadata = {'url': '/lro/error/put/200/invalidjson'} + def put200_invalid_json( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put200_invalid_json( + product=product, + **kwargs + ).result() + + def _put_async_relative_retry_invalid_header_initial( self, product=None, # type: Optional["models.Product"] @@ -1924,6 +2130,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/putasync/retry/invalidheader'} + def put_async_relative_retry_invalid_header( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_async_relative_retry_invalid_header( + product=product, + **kwargs + ).result() + + def _put_async_relative_retry_invalid_json_polling_initial( self, product=None, # type: Optional["models.Product"] @@ -2034,6 +2252,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/putasync/retry/invalidjsonpolling'} + def put_async_relative_retry_invalid_json_polling( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> "models.Product" + return self.begin_put_async_relative_retry_invalid_json_polling( + product=product, + **kwargs + ).result() + + def _delete202_retry_invalid_header_initial( self, **kwargs # type: Any @@ -2118,6 +2348,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry_invalid_header.metadata = {'url': '/lro/error/delete/202/retry/invalidheader'} + def delete202_retry_invalid_header( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete202_retry_invalid_header( + **kwargs + ).result() + + def _delete_async_relative_retry_invalid_header_initial( self, **kwargs # type: Any @@ -2203,6 +2443,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/deleteasync/retry/invalidheader'} + def delete_async_relative_retry_invalid_header( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete_async_relative_retry_invalid_header( + **kwargs + ).result() + + def _delete_async_relative_retry_invalid_json_polling_initial( self, **kwargs # type: Any @@ -2288,6 +2538,16 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/deleteasync/retry/invalidjsonpolling'} + def delete_async_relative_retry_invalid_json_polling( + self, + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_delete_async_relative_retry_invalid_json_polling( + **kwargs + ).result() + + def _post202_retry_invalid_header_initial( self, product=None, # type: Optional["models.Product"] @@ -2386,6 +2646,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry_invalid_header.metadata = {'url': '/lro/error/post/202/retry/invalidheader'} + def post202_retry_invalid_header( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_post202_retry_invalid_header( + product=product, + **kwargs + ).result() + + def _post_async_relative_retry_invalid_header_initial( self, product=None, # type: Optional["models.Product"] @@ -2485,6 +2757,18 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/postasync/retry/invalidheader'} + def post_async_relative_retry_invalid_header( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_post_async_relative_retry_invalid_header( + product=product, + **kwargs + ).result() + + def _post_async_relative_retry_invalid_json_polling_initial( self, product=None, # type: Optional["models.Product"] @@ -2583,3 +2867,15 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/postasync/retry/invalidjsonpolling'} + + def post_async_relative_retry_invalid_json_polling( + self, + product=None, # type: Optional["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + return self.begin_post_async_relative_retry_invalid_json_polling( + product=product, + **kwargs + ).result() + From 60d005e0058eaed1f4084643d1bea483d4a00b59 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Mon, 13 Apr 2020 16:29:12 -0700 Subject: [PATCH 05/26] Async continuation token tests --- test/azure/AcceptanceTests/asynctests/test_lro.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/azure/AcceptanceTests/asynctests/test_lro.py b/test/azure/AcceptanceTests/asynctests/test_lro.py index 67af1e63da8..6c151b833b3 100644 --- a/test/azure/AcceptanceTests/asynctests/test_lro.py +++ b/test/azure/AcceptanceTests/asynctests/test_lro.py @@ -130,10 +130,11 @@ async def lro_result(self, func, *args, **kwargs): @pytest.mark.asyncio async def test_post_double_headers_final(self, client): - product = await client.lros.post_double_headers_final_location_get() - assert product.id == "100" + poller = await client.lros.begin_post_double_headers_final_location_get() + continuation_token = poller.continuation_token() - product = await client.lros.post_double_headers_final_azure_header_get() + poller = await client.lros.begin_post_double_headers_final_location_get(continuation_token=continuation_token) + product = await poller assert product.id == "100" @pytest.mark.asyncio From 69149457580067d2348793023ad51a420ec925a5 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Thu, 21 May 2020 11:01:59 -0700 Subject: [PATCH 06/26] Remove not-begin approach --- .../codegen/templates/lro_operation.py.jinja2 | 20 - .../_lr_os_custom_header_operations_async.py | 40 -- .../_lro_retrys_operations_async.py | 64 --- .../_lros_operations_async.py | 376 ---------------- .../_lrosads_operations_async.py | 244 ---------- .../_lr_os_custom_header_operations.py | 44 -- .../lro/operations/_lro_retrys_operations.py | 71 --- .../Lro/lro/operations/_lros_operations.py | 417 ------------------ .../Lro/lro/operations/_lrosads_operations.py | 270 ------------ 9 files changed, 1546 deletions(-) diff --git a/autorest/codegen/templates/lro_operation.py.jinja2 b/autorest/codegen/templates/lro_operation.py.jinja2 index a724443ac8e..b21f7f8e772 100644 --- a/autorest/codegen/templates/lro_operation.py.jinja2 +++ b/autorest/codegen/templates/lro_operation.py.jinja2 @@ -102,23 +102,3 @@ response_headers = { else: return {{ poller }}(self._client, raw_result, get_long_running_output, polling_method) {{ operation_name }}.metadata = {'url': '{{ operation.url }}'} # type: ignore - -{{ op_tools.method_signature(operation, operation.python_name, async_mode=async_mode, coroutine=async_mode) }} -{%- if not async_mode %} - {{ op_tools.return_type_annotation(operation) }} -{% endif %} -{% if async_mode %} - return await (await self.begin_{{ operation.python_name }}( - {% for param_signature in operation.parameters.method %} - {{ param_signature.serialized_name }}={{ param_signature.serialized_name }}, - {% endfor %} - **kwargs - )) -{% else %} - return self.begin_{{ operation.python_name }}( - {% for param_signature in operation.parameters.method %} - {{ param_signature.serialized_name }}={{ param_signature.serialized_name }}, - {% endfor %} - **kwargs - ).result() -{% endif %} diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py index 123faa32930..bf18875907e 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py @@ -158,16 +158,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_succeeded.metadata = {'url': '/lro/customheader/putasync/retry/succeeded'} # type: ignore - async def put_async_retry_succeeded( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_async_retry_succeeded( - product=product, - **kwargs - )) - async def _put201_creating_succeeded200_initial( self, @@ -280,16 +270,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/customheader/put/201/creating/succeeded/200'} # type: ignore - async def put201_creating_succeeded200( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put201_creating_succeeded200( - product=product, - **kwargs - )) - async def _post202_retry200_initial( self, @@ -393,16 +373,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/customheader/post/202/retry/200'} # type: ignore - async def post202_retry200( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> None: - return await (await self.begin_post202_retry200( - product=product, - **kwargs - )) - async def _post_async_retry_succeeded_initial( self, @@ -508,13 +478,3 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_succeeded.metadata = {'url': '/lro/customheader/postasync/retry/succeeded'} # type: ignore - async def post_async_retry_succeeded( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> None: - return await (await self.begin_post_async_retry_succeeded( - product=product, - **kwargs - )) - diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py index cdecf0ca157..cf0588fe016 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py @@ -153,16 +153,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/retryerror/put/201/creating/succeeded/200'} # type: ignore - async def put201_creating_succeeded200( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put201_creating_succeeded200( - product=product, - **kwargs - )) - async def _put_async_relative_retry_succeeded_initial( self, @@ -278,16 +268,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/putasync/retry/succeeded'} # type: ignore - async def put_async_relative_retry_succeeded( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_async_relative_retry_succeeded( - product=product, - **kwargs - )) - async def _delete_provisioning202_accepted200_succeeded_initial( self, @@ -392,14 +372,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/retryerror/delete/provisioning/202/accepted/200/succeeded'} # type: ignore - async def delete_provisioning202_accepted200_succeeded( - self, - **kwargs - ) -> "models.Product": - return await (await self.begin_delete_provisioning202_accepted200_succeeded( - **kwargs - )) - async def _delete202_retry200_initial( self, @@ -488,14 +460,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry200.metadata = {'url': '/lro/retryerror/delete/202/retry/200'} # type: ignore - async def delete202_retry200( - self, - **kwargs - ) -> None: - return await (await self.begin_delete202_retry200( - **kwargs - )) - async def _delete_async_relative_retry_succeeded_initial( self, @@ -585,14 +549,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/deleteasync/retry/succeeded'} # type: ignore - async def delete_async_relative_retry_succeeded( - self, - **kwargs - ) -> None: - return await (await self.begin_delete_async_relative_retry_succeeded( - **kwargs - )) - async def _post202_retry200_initial( self, @@ -695,16 +651,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/retryerror/post/202/retry/200'} # type: ignore - async def post202_retry200( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> None: - return await (await self.begin_post202_retry200( - product=product, - **kwargs - )) - async def _post_async_relative_retry_succeeded_initial( self, @@ -809,13 +755,3 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/postasync/retry/succeeded'} # type: ignore - async def post_async_relative_retry_succeeded( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> None: - return await (await self.begin_post_async_relative_retry_succeeded( - product=product, - **kwargs - )) - diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py index cb01b07a361..5df58915565 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py @@ -149,16 +149,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_succeeded.metadata = {'url': '/lro/put/200/succeeded'} # type: ignore - async def put200_succeeded( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put200_succeeded( - product=product, - **kwargs - )) - async def _put201_succeeded_initial( self, @@ -264,16 +254,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_succeeded.metadata = {'url': '/lro/put/201/succeeded'} # type: ignore - async def put201_succeeded( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put201_succeeded( - product=product, - **kwargs - )) - async def _post202_list_initial( self, @@ -372,14 +352,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_list.metadata = {'url': '/lro/list'} # type: ignore - async def post202_list( - self, - **kwargs - ) -> List["models.Product"]: - return await (await self.begin_post202_list( - **kwargs - )) - async def _put200_succeeded_no_state_initial( self, @@ -485,16 +457,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_succeeded_no_state.metadata = {'url': '/lro/put/200/succeeded/nostate'} # type: ignore - async def put200_succeeded_no_state( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put200_succeeded_no_state( - product=product, - **kwargs - )) - async def _put202_retry200_initial( self, @@ -601,16 +563,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put202_retry200.metadata = {'url': '/lro/put/202/retry/200'} # type: ignore - async def put202_retry200( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put202_retry200( - product=product, - **kwargs - )) - async def _put201_creating_succeeded200_initial( self, @@ -722,16 +674,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/put/201/creating/succeeded/200'} # type: ignore - async def put201_creating_succeeded200( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put201_creating_succeeded200( - product=product, - **kwargs - )) - async def _put200_updating_succeeded204_initial( self, @@ -838,16 +780,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_updating_succeeded204.metadata = {'url': '/lro/put/200/updating/succeeded/200'} # type: ignore - async def put200_updating_succeeded204( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put200_updating_succeeded204( - product=product, - **kwargs - )) - async def _put201_creating_failed200_initial( self, @@ -959,16 +891,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_failed200.metadata = {'url': '/lro/put/201/created/failed/200'} # type: ignore - async def put201_creating_failed200( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put201_creating_failed200( - product=product, - **kwargs - )) - async def _put200_acceptedcanceled200_initial( self, @@ -1075,16 +997,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_acceptedcanceled200.metadata = {'url': '/lro/put/200/accepted/canceled/200'} # type: ignore - async def put200_acceptedcanceled200( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put200_acceptedcanceled200( - product=product, - **kwargs - )) - async def _put_no_header_in_retry_initial( self, @@ -1195,16 +1107,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_no_header_in_retry.metadata = {'url': '/lro/put/noheader/202/200'} # type: ignore - async def put_no_header_in_retry( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_no_header_in_retry( - product=product, - **kwargs - )) - async def _put_async_retry_succeeded_initial( self, @@ -1320,16 +1222,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_succeeded.metadata = {'url': '/lro/putasync/retry/succeeded'} # type: ignore - async def put_async_retry_succeeded( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_async_retry_succeeded( - product=product, - **kwargs - )) - async def _put_async_no_retry_succeeded_initial( self, @@ -1443,16 +1335,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_retry_succeeded.metadata = {'url': '/lro/putasync/noretry/succeeded'} # type: ignore - async def put_async_no_retry_succeeded( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_async_no_retry_succeeded( - product=product, - **kwargs - )) - async def _put_async_retry_failed_initial( self, @@ -1568,16 +1450,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_failed.metadata = {'url': '/lro/putasync/retry/failed'} # type: ignore - async def put_async_retry_failed( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_async_retry_failed( - product=product, - **kwargs - )) - async def _put_async_no_retrycanceled_initial( self, @@ -1691,16 +1563,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_retrycanceled.metadata = {'url': '/lro/putasync/noretry/canceled'} # type: ignore - async def put_async_no_retrycanceled( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_async_no_retrycanceled( - product=product, - **kwargs - )) - async def _put_async_no_header_in_retry_initial( self, @@ -1812,16 +1674,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_header_in_retry.metadata = {'url': '/lro/putasync/noheader/201/200'} # type: ignore - async def put_async_no_header_in_retry( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_async_no_header_in_retry( - product=product, - **kwargs - )) - async def _put_non_resource_initial( self, @@ -1926,16 +1778,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_resource.metadata = {'url': '/lro/putnonresource/202/200'} # type: ignore - async def put_non_resource( - self, - sku: Optional["models.Sku"] = None, - **kwargs - ) -> "models.Sku": - return await (await self.begin_put_non_resource( - sku=sku, - **kwargs - )) - async def _put_async_non_resource_initial( self, @@ -2040,16 +1882,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_non_resource.metadata = {'url': '/lro/putnonresourceasync/202/200'} # type: ignore - async def put_async_non_resource( - self, - sku: Optional["models.Sku"] = None, - **kwargs - ) -> "models.Sku": - return await (await self.begin_put_async_non_resource( - sku=sku, - **kwargs - )) - async def _put_sub_resource_initial( self, @@ -2156,16 +1988,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_sub_resource.metadata = {'url': '/lro/putsubresource/202/200'} # type: ignore - async def put_sub_resource( - self, - provisioning_state: Optional[str] = None, - **kwargs - ) -> "models.SubProduct": - return await (await self.begin_put_sub_resource( - provisioning_state=provisioning_state, - **kwargs - )) - async def _put_async_sub_resource_initial( self, @@ -2272,16 +2094,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_sub_resource.metadata = {'url': '/lro/putsubresourceasync/202/200'} # type: ignore - async def put_async_sub_resource( - self, - provisioning_state: Optional[str] = None, - **kwargs - ) -> "models.SubProduct": - return await (await self.begin_put_async_sub_resource( - provisioning_state=provisioning_state, - **kwargs - )) - async def _delete_provisioning202_accepted200_succeeded_initial( self, @@ -2386,14 +2198,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/delete/provisioning/202/accepted/200/succeeded'} # type: ignore - async def delete_provisioning202_accepted200_succeeded( - self, - **kwargs - ) -> "models.Product": - return await (await self.begin_delete_provisioning202_accepted200_succeeded( - **kwargs - )) - async def _delete_provisioning202_deleting_failed200_initial( self, @@ -2498,14 +2302,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_deleting_failed200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/failed'} # type: ignore - async def delete_provisioning202_deleting_failed200( - self, - **kwargs - ) -> "models.Product": - return await (await self.begin_delete_provisioning202_deleting_failed200( - **kwargs - )) - async def _delete_provisioning202_deletingcanceled200_initial( self, @@ -2610,14 +2406,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_deletingcanceled200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/canceled'} # type: ignore - async def delete_provisioning202_deletingcanceled200( - self, - **kwargs - ) -> "models.Product": - return await (await self.begin_delete_provisioning202_deletingcanceled200( - **kwargs - )) - async def _delete204_succeeded_initial( self, @@ -2701,14 +2489,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete204_succeeded.metadata = {'url': '/lro/delete/204/succeeded'} # type: ignore - async def delete204_succeeded( - self, - **kwargs - ) -> None: - return await (await self.begin_delete204_succeeded( - **kwargs - )) - async def _delete202_retry200_initial( self, @@ -2807,14 +2587,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry200.metadata = {'url': '/lro/delete/202/retry/200'} # type: ignore - async def delete202_retry200( - self, - **kwargs - ) -> "models.Product": - return await (await self.begin_delete202_retry200( - **kwargs - )) - async def _delete202_no_retry204_initial( self, @@ -2913,14 +2685,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_no_retry204.metadata = {'url': '/lro/delete/202/noretry/204'} # type: ignore - async def delete202_no_retry204( - self, - **kwargs - ) -> "models.Product": - return await (await self.begin_delete202_no_retry204( - **kwargs - )) - async def _delete_no_header_in_retry_initial( self, @@ -3009,14 +2773,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_no_header_in_retry.metadata = {'url': '/lro/delete/noheader'} # type: ignore - async def delete_no_header_in_retry( - self, - **kwargs - ) -> None: - return await (await self.begin_delete_no_header_in_retry( - **kwargs - )) - async def _delete_async_no_header_in_retry_initial( self, @@ -3105,14 +2861,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_no_header_in_retry.metadata = {'url': '/lro/deleteasync/noheader/202/204'} # type: ignore - async def delete_async_no_header_in_retry( - self, - **kwargs - ) -> None: - return await (await self.begin_delete_async_no_header_in_retry( - **kwargs - )) - async def _delete_async_retry_succeeded_initial( self, @@ -3202,14 +2950,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retry_succeeded.metadata = {'url': '/lro/deleteasync/retry/succeeded'} # type: ignore - async def delete_async_retry_succeeded( - self, - **kwargs - ) -> None: - return await (await self.begin_delete_async_retry_succeeded( - **kwargs - )) - async def _delete_async_no_retry_succeeded_initial( self, @@ -3299,14 +3039,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_no_retry_succeeded.metadata = {'url': '/lro/deleteasync/noretry/succeeded'} # type: ignore - async def delete_async_no_retry_succeeded( - self, - **kwargs - ) -> None: - return await (await self.begin_delete_async_no_retry_succeeded( - **kwargs - )) - async def _delete_async_retry_failed_initial( self, @@ -3396,14 +3128,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retry_failed.metadata = {'url': '/lro/deleteasync/retry/failed'} # type: ignore - async def delete_async_retry_failed( - self, - **kwargs - ) -> None: - return await (await self.begin_delete_async_retry_failed( - **kwargs - )) - async def _delete_async_retrycanceled_initial( self, @@ -3493,14 +3217,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retrycanceled.metadata = {'url': '/lro/deleteasync/retry/canceled'} # type: ignore - async def delete_async_retrycanceled( - self, - **kwargs - ) -> None: - return await (await self.begin_delete_async_retrycanceled( - **kwargs - )) - async def _post200_with_payload_initial( self, @@ -3597,14 +3313,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post200_with_payload.metadata = {'url': '/lro/post/payload/200'} # type: ignore - async def post200_with_payload( - self, - **kwargs - ) -> "models.Sku": - return await (await self.begin_post200_with_payload( - **kwargs - )) - async def _post202_retry200_initial( self, @@ -3707,16 +3415,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/post/202/retry/200'} # type: ignore - async def post202_retry200( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> None: - return await (await self.begin_post202_retry200( - product=product, - **kwargs - )) - async def _post202_no_retry204_initial( self, @@ -3829,16 +3527,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_no_retry204.metadata = {'url': '/lro/post/202/noretry/204'} # type: ignore - async def post202_no_retry204( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_post202_no_retry204( - product=product, - **kwargs - )) - async def _post_double_headers_final_location_get_initial( self, @@ -3931,14 +3619,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_location_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalLocationGet'} # type: ignore - async def post_double_headers_final_location_get( - self, - **kwargs - ) -> "models.Product": - return await (await self.begin_post_double_headers_final_location_get( - **kwargs - )) - async def _post_double_headers_final_azure_header_get_initial( self, @@ -4031,14 +3711,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_azure_header_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGet'} # type: ignore - async def post_double_headers_final_azure_header_get( - self, - **kwargs - ) -> "models.Product": - return await (await self.begin_post_double_headers_final_azure_header_get( - **kwargs - )) - async def _post_double_headers_final_azure_header_get_default_initial( self, @@ -4131,14 +3803,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_azure_header_get_default.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGetDefault'} # type: ignore - async def post_double_headers_final_azure_header_get_default( - self, - **kwargs - ) -> "models.Product": - return await (await self.begin_post_double_headers_final_azure_header_get_default( - **kwargs - )) - async def _post_async_retry_succeeded_initial( self, @@ -4253,16 +3917,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_succeeded.metadata = {'url': '/lro/postasync/retry/succeeded'} # type: ignore - async def post_async_retry_succeeded( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_post_async_retry_succeeded( - product=product, - **kwargs - )) - async def _post_async_no_retry_succeeded_initial( self, @@ -4377,16 +4031,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_no_retry_succeeded.metadata = {'url': '/lro/postasync/noretry/succeeded'} # type: ignore - async def post_async_no_retry_succeeded( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_post_async_no_retry_succeeded( - product=product, - **kwargs - )) - async def _post_async_retry_failed_initial( self, @@ -4491,16 +4135,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_failed.metadata = {'url': '/lro/postasync/retry/failed'} # type: ignore - async def post_async_retry_failed( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> None: - return await (await self.begin_post_async_retry_failed( - product=product, - **kwargs - )) - async def _post_async_retrycanceled_initial( self, @@ -4605,13 +4239,3 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retrycanceled.metadata = {'url': '/lro/postasync/retry/canceled'} # type: ignore - async def post_async_retrycanceled( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> None: - return await (await self.begin_post_async_retrycanceled( - product=product, - **kwargs - )) - diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py index 7d1fcab158f..3aed379ac50 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py @@ -151,16 +151,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry400.metadata = {'url': '/lro/nonretryerror/put/400'} # type: ignore - async def put_non_retry400( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_non_retry400( - product=product, - **kwargs - )) - async def _put_non_retry201_creating400_initial( self, @@ -271,16 +261,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry201_creating400.metadata = {'url': '/lro/nonretryerror/put/201/creating/400'} # type: ignore - async def put_non_retry201_creating400( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_non_retry201_creating400( - product=product, - **kwargs - )) - async def _put_non_retry201_creating400_invalid_json_initial( self, @@ -391,16 +371,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry201_creating400_invalid_json.metadata = {'url': '/lro/nonretryerror/put/201/creating/400/invalidjson'} # type: ignore - async def put_non_retry201_creating400_invalid_json( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_non_retry201_creating400_invalid_json( - product=product, - **kwargs - )) - async def _put_async_relative_retry400_initial( self, @@ -515,16 +485,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/putasync/retry/400'} # type: ignore - async def put_async_relative_retry400( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_async_relative_retry400( - product=product, - **kwargs - )) - async def _delete_non_retry400_initial( self, @@ -612,14 +572,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/400'} # type: ignore - async def delete_non_retry400( - self, - **kwargs - ) -> None: - return await (await self.begin_delete_non_retry400( - **kwargs - )) - async def _delete202_non_retry400_initial( self, @@ -707,14 +659,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/202/retry/400'} # type: ignore - async def delete202_non_retry400( - self, - **kwargs - ) -> None: - return await (await self.begin_delete202_non_retry400( - **kwargs - )) - async def _delete_async_relative_retry400_initial( self, @@ -804,14 +748,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/deleteasync/retry/400'} # type: ignore - async def delete_async_relative_retry400( - self, - **kwargs - ) -> None: - return await (await self.begin_delete_async_relative_retry400( - **kwargs - )) - async def _post_non_retry400_initial( self, @@ -913,16 +849,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_non_retry400.metadata = {'url': '/lro/nonretryerror/post/400'} # type: ignore - async def post_non_retry400( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> None: - return await (await self.begin_post_non_retry400( - product=product, - **kwargs - )) - async def _post202_non_retry400_initial( self, @@ -1024,16 +950,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_non_retry400.metadata = {'url': '/lro/nonretryerror/post/202/retry/400'} # type: ignore - async def post202_non_retry400( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> None: - return await (await self.begin_post202_non_retry400( - product=product, - **kwargs - )) - async def _post_async_relative_retry400_initial( self, @@ -1137,16 +1053,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/postasync/retry/400'} # type: ignore - async def post_async_relative_retry400( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> None: - return await (await self.begin_post_async_relative_retry400( - product=product, - **kwargs - )) - async def _put_error201_no_provisioning_state_payload_initial( self, @@ -1256,16 +1162,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_error201_no_provisioning_state_payload.metadata = {'url': '/lro/error/put/201/noprovisioningstatepayload'} # type: ignore - async def put_error201_no_provisioning_state_payload( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_error201_no_provisioning_state_payload( - product=product, - **kwargs - )) - async def _put_async_relative_retry_no_status_initial( self, @@ -1381,16 +1277,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_no_status.metadata = {'url': '/lro/error/putasync/retry/nostatus'} # type: ignore - async def put_async_relative_retry_no_status( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_async_relative_retry_no_status( - product=product, - **kwargs - )) - async def _put_async_relative_retry_no_status_payload_initial( self, @@ -1506,16 +1392,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_no_status_payload.metadata = {'url': '/lro/error/putasync/retry/nostatuspayload'} # type: ignore - async def put_async_relative_retry_no_status_payload( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_async_relative_retry_no_status_payload( - product=product, - **kwargs - )) - async def _delete204_succeeded_initial( self, @@ -1599,14 +1475,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete204_succeeded.metadata = {'url': '/lro/error/delete/204/nolocation'} # type: ignore - async def delete204_succeeded( - self, - **kwargs - ) -> None: - return await (await self.begin_delete204_succeeded( - **kwargs - )) - async def _delete_async_relative_retry_no_status_initial( self, @@ -1696,14 +1564,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_no_status.metadata = {'url': '/lro/error/deleteasync/retry/nostatus'} # type: ignore - async def delete_async_relative_retry_no_status( - self, - **kwargs - ) -> None: - return await (await self.begin_delete_async_relative_retry_no_status( - **kwargs - )) - async def _post202_no_location_initial( self, @@ -1806,16 +1666,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_no_location.metadata = {'url': '/lro/error/post/202/nolocation'} # type: ignore - async def post202_no_location( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> None: - return await (await self.begin_post202_no_location( - product=product, - **kwargs - )) - async def _post_async_relative_retry_no_payload_initial( self, @@ -1920,16 +1770,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_no_payload.metadata = {'url': '/lro/error/postasync/retry/nopayload'} # type: ignore - async def post_async_relative_retry_no_payload( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> None: - return await (await self.begin_post_async_relative_retry_no_payload( - product=product, - **kwargs - )) - async def _put200_invalid_json_initial( self, @@ -2037,16 +1877,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_invalid_json.metadata = {'url': '/lro/error/put/200/invalidjson'} # type: ignore - async def put200_invalid_json( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put200_invalid_json( - product=product, - **kwargs - )) - async def _put_async_relative_retry_invalid_header_initial( self, @@ -2162,16 +1992,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/putasync/retry/invalidheader'} # type: ignore - async def put_async_relative_retry_invalid_header( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_async_relative_retry_invalid_header( - product=product, - **kwargs - )) - async def _put_async_relative_retry_invalid_json_polling_initial( self, @@ -2287,16 +2107,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/putasync/retry/invalidjsonpolling'} # type: ignore - async def put_async_relative_retry_invalid_json_polling( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> "models.Product": - return await (await self.begin_put_async_relative_retry_invalid_json_polling( - product=product, - **kwargs - )) - async def _delete202_retry_invalid_header_initial( self, @@ -2385,14 +2195,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry_invalid_header.metadata = {'url': '/lro/error/delete/202/retry/invalidheader'} # type: ignore - async def delete202_retry_invalid_header( - self, - **kwargs - ) -> None: - return await (await self.begin_delete202_retry_invalid_header( - **kwargs - )) - async def _delete_async_relative_retry_invalid_header_initial( self, @@ -2482,14 +2284,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/deleteasync/retry/invalidheader'} # type: ignore - async def delete_async_relative_retry_invalid_header( - self, - **kwargs - ) -> None: - return await (await self.begin_delete_async_relative_retry_invalid_header( - **kwargs - )) - async def _delete_async_relative_retry_invalid_json_polling_initial( self, @@ -2579,14 +2373,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/deleteasync/retry/invalidjsonpolling'} # type: ignore - async def delete_async_relative_retry_invalid_json_polling( - self, - **kwargs - ) -> None: - return await (await self.begin_delete_async_relative_retry_invalid_json_polling( - **kwargs - )) - async def _post202_retry_invalid_header_initial( self, @@ -2689,16 +2475,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry_invalid_header.metadata = {'url': '/lro/error/post/202/retry/invalidheader'} # type: ignore - async def post202_retry_invalid_header( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> None: - return await (await self.begin_post202_retry_invalid_header( - product=product, - **kwargs - )) - async def _post_async_relative_retry_invalid_header_initial( self, @@ -2803,16 +2579,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/postasync/retry/invalidheader'} # type: ignore - async def post_async_relative_retry_invalid_header( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> None: - return await (await self.begin_post_async_relative_retry_invalid_header( - product=product, - **kwargs - )) - async def _post_async_relative_retry_invalid_json_polling_initial( self, @@ -2917,13 +2683,3 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/postasync/retry/invalidjsonpolling'} # type: ignore - async def post_async_relative_retry_invalid_json_polling( - self, - product: Optional["models.Product"] = None, - **kwargs - ) -> None: - return await (await self.begin_post_async_relative_retry_invalid_json_polling( - product=product, - **kwargs - )) - diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py index 17da148ec47..d202b1424e7 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py @@ -164,17 +164,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_succeeded.metadata = {'url': '/lro/customheader/putasync/retry/succeeded'} # type: ignore - def put_async_retry_succeeded( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_async_retry_succeeded( - product=product, - **kwargs - ).result() - def _put201_creating_succeeded200_initial( self, @@ -289,17 +278,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/customheader/put/201/creating/succeeded/200'} # type: ignore - def put201_creating_succeeded200( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put201_creating_succeeded200( - product=product, - **kwargs - ).result() - def _post202_retry200_initial( self, @@ -405,17 +383,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/customheader/post/202/retry/200'} # type: ignore - def post202_retry200( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - None - return self.begin_post202_retry200( - product=product, - **kwargs - ).result() - def _post_async_retry_succeeded_initial( self, @@ -523,14 +490,3 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_succeeded.metadata = {'url': '/lro/customheader/postasync/retry/succeeded'} # type: ignore - def post_async_retry_succeeded( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - None - return self.begin_post_async_retry_succeeded( - product=product, - **kwargs - ).result() - diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py index cdf221ac07c..c6e619ace7f 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py @@ -159,17 +159,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/retryerror/put/201/creating/succeeded/200'} # type: ignore - def put201_creating_succeeded200( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put201_creating_succeeded200( - product=product, - **kwargs - ).result() - def _put_async_relative_retry_succeeded_initial( self, @@ -287,17 +276,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/putasync/retry/succeeded'} # type: ignore - def put_async_relative_retry_succeeded( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_async_relative_retry_succeeded( - product=product, - **kwargs - ).result() - def _delete_provisioning202_accepted200_succeeded_initial( self, @@ -404,15 +382,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/retryerror/delete/provisioning/202/accepted/200/succeeded'} # type: ignore - def delete_provisioning202_accepted200_succeeded( - self, - **kwargs # type: Any - ): - "models.Product" - return self.begin_delete_provisioning202_accepted200_succeeded( - **kwargs - ).result() - def _delete202_retry200_initial( self, @@ -503,15 +472,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry200.metadata = {'url': '/lro/retryerror/delete/202/retry/200'} # type: ignore - def delete202_retry200( - self, - **kwargs # type: Any - ): - None - return self.begin_delete202_retry200( - **kwargs - ).result() - def _delete_async_relative_retry_succeeded_initial( self, @@ -603,15 +563,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/deleteasync/retry/succeeded'} # type: ignore - def delete_async_relative_retry_succeeded( - self, - **kwargs # type: Any - ): - None - return self.begin_delete_async_relative_retry_succeeded( - **kwargs - ).result() - def _post202_retry200_initial( self, @@ -716,17 +667,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/retryerror/post/202/retry/200'} # type: ignore - def post202_retry200( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - None - return self.begin_post202_retry200( - product=product, - **kwargs - ).result() - def _post_async_relative_retry_succeeded_initial( self, @@ -833,14 +773,3 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/postasync/retry/succeeded'} # type: ignore - def post_async_relative_retry_succeeded( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - None - return self.begin_post_async_relative_retry_succeeded( - product=product, - **kwargs - ).result() - diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py index 2399e5deba3..612b4752087 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py @@ -155,17 +155,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_succeeded.metadata = {'url': '/lro/put/200/succeeded'} # type: ignore - def put200_succeeded( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put200_succeeded( - product=product, - **kwargs - ).result() - def _put201_succeeded_initial( self, @@ -273,17 +262,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_succeeded.metadata = {'url': '/lro/put/201/succeeded'} # type: ignore - def put201_succeeded( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put201_succeeded( - product=product, - **kwargs - ).result() - def _post202_list_initial( self, @@ -384,15 +362,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_list.metadata = {'url': '/lro/list'} # type: ignore - def post202_list( - self, - **kwargs # type: Any - ): - List["models.Product"] - return self.begin_post202_list( - **kwargs - ).result() - def _put200_succeeded_no_state_initial( self, @@ -500,17 +469,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_succeeded_no_state.metadata = {'url': '/lro/put/200/succeeded/nostate'} # type: ignore - def put200_succeeded_no_state( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put200_succeeded_no_state( - product=product, - **kwargs - ).result() - def _put202_retry200_initial( self, @@ -619,17 +577,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put202_retry200.metadata = {'url': '/lro/put/202/retry/200'} # type: ignore - def put202_retry200( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put202_retry200( - product=product, - **kwargs - ).result() - def _put201_creating_succeeded200_initial( self, @@ -743,17 +690,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/put/201/creating/succeeded/200'} # type: ignore - def put201_creating_succeeded200( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put201_creating_succeeded200( - product=product, - **kwargs - ).result() - def _put200_updating_succeeded204_initial( self, @@ -862,17 +798,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_updating_succeeded204.metadata = {'url': '/lro/put/200/updating/succeeded/200'} # type: ignore - def put200_updating_succeeded204( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put200_updating_succeeded204( - product=product, - **kwargs - ).result() - def _put201_creating_failed200_initial( self, @@ -986,17 +911,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_failed200.metadata = {'url': '/lro/put/201/created/failed/200'} # type: ignore - def put201_creating_failed200( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put201_creating_failed200( - product=product, - **kwargs - ).result() - def _put200_acceptedcanceled200_initial( self, @@ -1105,17 +1019,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_acceptedcanceled200.metadata = {'url': '/lro/put/200/accepted/canceled/200'} # type: ignore - def put200_acceptedcanceled200( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put200_acceptedcanceled200( - product=product, - **kwargs - ).result() - def _put_no_header_in_retry_initial( self, @@ -1228,17 +1131,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_no_header_in_retry.metadata = {'url': '/lro/put/noheader/202/200'} # type: ignore - def put_no_header_in_retry( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_no_header_in_retry( - product=product, - **kwargs - ).result() - def _put_async_retry_succeeded_initial( self, @@ -1356,17 +1248,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_succeeded.metadata = {'url': '/lro/putasync/retry/succeeded'} # type: ignore - def put_async_retry_succeeded( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_async_retry_succeeded( - product=product, - **kwargs - ).result() - def _put_async_no_retry_succeeded_initial( self, @@ -1482,17 +1363,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_retry_succeeded.metadata = {'url': '/lro/putasync/noretry/succeeded'} # type: ignore - def put_async_no_retry_succeeded( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_async_no_retry_succeeded( - product=product, - **kwargs - ).result() - def _put_async_retry_failed_initial( self, @@ -1610,17 +1480,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_failed.metadata = {'url': '/lro/putasync/retry/failed'} # type: ignore - def put_async_retry_failed( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_async_retry_failed( - product=product, - **kwargs - ).result() - def _put_async_no_retrycanceled_initial( self, @@ -1736,17 +1595,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_retrycanceled.metadata = {'url': '/lro/putasync/noretry/canceled'} # type: ignore - def put_async_no_retrycanceled( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_async_no_retrycanceled( - product=product, - **kwargs - ).result() - def _put_async_no_header_in_retry_initial( self, @@ -1860,17 +1708,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_header_in_retry.metadata = {'url': '/lro/putasync/noheader/201/200'} # type: ignore - def put_async_no_header_in_retry( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_async_no_header_in_retry( - product=product, - **kwargs - ).result() - def _put_non_resource_initial( self, @@ -1977,17 +1814,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_resource.metadata = {'url': '/lro/putnonresource/202/200'} # type: ignore - def put_non_resource( - self, - sku=None, # type: Optional["models.Sku"] - **kwargs # type: Any - ): - "models.Sku" - return self.begin_put_non_resource( - sku=sku, - **kwargs - ).result() - def _put_async_non_resource_initial( self, @@ -2094,17 +1920,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_non_resource.metadata = {'url': '/lro/putnonresourceasync/202/200'} # type: ignore - def put_async_non_resource( - self, - sku=None, # type: Optional["models.Sku"] - **kwargs # type: Any - ): - "models.Sku" - return self.begin_put_async_non_resource( - sku=sku, - **kwargs - ).result() - def _put_sub_resource_initial( self, @@ -2213,17 +2028,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_sub_resource.metadata = {'url': '/lro/putsubresource/202/200'} # type: ignore - def put_sub_resource( - self, - provisioning_state=None, # type: Optional[str] - **kwargs # type: Any - ): - "models.SubProduct" - return self.begin_put_sub_resource( - provisioning_state=provisioning_state, - **kwargs - ).result() - def _put_async_sub_resource_initial( self, @@ -2332,17 +2136,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_sub_resource.metadata = {'url': '/lro/putsubresourceasync/202/200'} # type: ignore - def put_async_sub_resource( - self, - provisioning_state=None, # type: Optional[str] - **kwargs # type: Any - ): - "models.SubProduct" - return self.begin_put_async_sub_resource( - provisioning_state=provisioning_state, - **kwargs - ).result() - def _delete_provisioning202_accepted200_succeeded_initial( self, @@ -2449,15 +2242,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/delete/provisioning/202/accepted/200/succeeded'} # type: ignore - def delete_provisioning202_accepted200_succeeded( - self, - **kwargs # type: Any - ): - "models.Product" - return self.begin_delete_provisioning202_accepted200_succeeded( - **kwargs - ).result() - def _delete_provisioning202_deleting_failed200_initial( self, @@ -2564,15 +2348,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_deleting_failed200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/failed'} # type: ignore - def delete_provisioning202_deleting_failed200( - self, - **kwargs # type: Any - ): - "models.Product" - return self.begin_delete_provisioning202_deleting_failed200( - **kwargs - ).result() - def _delete_provisioning202_deletingcanceled200_initial( self, @@ -2679,15 +2454,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_deletingcanceled200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/canceled'} # type: ignore - def delete_provisioning202_deletingcanceled200( - self, - **kwargs # type: Any - ): - "models.Product" - return self.begin_delete_provisioning202_deletingcanceled200( - **kwargs - ).result() - def _delete204_succeeded_initial( self, @@ -2773,15 +2539,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete204_succeeded.metadata = {'url': '/lro/delete/204/succeeded'} # type: ignore - def delete204_succeeded( - self, - **kwargs # type: Any - ): - None - return self.begin_delete204_succeeded( - **kwargs - ).result() - def _delete202_retry200_initial( self, @@ -2882,15 +2639,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry200.metadata = {'url': '/lro/delete/202/retry/200'} # type: ignore - def delete202_retry200( - self, - **kwargs # type: Any - ): - "models.Product" - return self.begin_delete202_retry200( - **kwargs - ).result() - def _delete202_no_retry204_initial( self, @@ -2991,15 +2739,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_no_retry204.metadata = {'url': '/lro/delete/202/noretry/204'} # type: ignore - def delete202_no_retry204( - self, - **kwargs # type: Any - ): - "models.Product" - return self.begin_delete202_no_retry204( - **kwargs - ).result() - def _delete_no_header_in_retry_initial( self, @@ -3090,15 +2829,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_no_header_in_retry.metadata = {'url': '/lro/delete/noheader'} # type: ignore - def delete_no_header_in_retry( - self, - **kwargs # type: Any - ): - None - return self.begin_delete_no_header_in_retry( - **kwargs - ).result() - def _delete_async_no_header_in_retry_initial( self, @@ -3189,15 +2919,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_no_header_in_retry.metadata = {'url': '/lro/deleteasync/noheader/202/204'} # type: ignore - def delete_async_no_header_in_retry( - self, - **kwargs # type: Any - ): - None - return self.begin_delete_async_no_header_in_retry( - **kwargs - ).result() - def _delete_async_retry_succeeded_initial( self, @@ -3289,15 +3010,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retry_succeeded.metadata = {'url': '/lro/deleteasync/retry/succeeded'} # type: ignore - def delete_async_retry_succeeded( - self, - **kwargs # type: Any - ): - None - return self.begin_delete_async_retry_succeeded( - **kwargs - ).result() - def _delete_async_no_retry_succeeded_initial( self, @@ -3389,15 +3101,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_no_retry_succeeded.metadata = {'url': '/lro/deleteasync/noretry/succeeded'} # type: ignore - def delete_async_no_retry_succeeded( - self, - **kwargs # type: Any - ): - None - return self.begin_delete_async_no_retry_succeeded( - **kwargs - ).result() - def _delete_async_retry_failed_initial( self, @@ -3489,15 +3192,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retry_failed.metadata = {'url': '/lro/deleteasync/retry/failed'} # type: ignore - def delete_async_retry_failed( - self, - **kwargs # type: Any - ): - None - return self.begin_delete_async_retry_failed( - **kwargs - ).result() - def _delete_async_retrycanceled_initial( self, @@ -3589,15 +3283,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retrycanceled.metadata = {'url': '/lro/deleteasync/retry/canceled'} # type: ignore - def delete_async_retrycanceled( - self, - **kwargs # type: Any - ): - None - return self.begin_delete_async_retrycanceled( - **kwargs - ).result() - def _post200_with_payload_initial( self, @@ -3696,15 +3381,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post200_with_payload.metadata = {'url': '/lro/post/payload/200'} # type: ignore - def post200_with_payload( - self, - **kwargs # type: Any - ): - "models.Sku" - return self.begin_post200_with_payload( - **kwargs - ).result() - def _post202_retry200_initial( self, @@ -3809,17 +3485,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/post/202/retry/200'} # type: ignore - def post202_retry200( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - None - return self.begin_post202_retry200( - product=product, - **kwargs - ).result() - def _post202_no_retry204_initial( self, @@ -3934,17 +3599,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_no_retry204.metadata = {'url': '/lro/post/202/noretry/204'} # type: ignore - def post202_no_retry204( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_post202_no_retry204( - product=product, - **kwargs - ).result() - def _post_double_headers_final_location_get_initial( self, @@ -4039,15 +3693,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_location_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalLocationGet'} # type: ignore - def post_double_headers_final_location_get( - self, - **kwargs # type: Any - ): - "models.Product" - return self.begin_post_double_headers_final_location_get( - **kwargs - ).result() - def _post_double_headers_final_azure_header_get_initial( self, @@ -4142,15 +3787,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_azure_header_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGet'} # type: ignore - def post_double_headers_final_azure_header_get( - self, - **kwargs # type: Any - ): - "models.Product" - return self.begin_post_double_headers_final_azure_header_get( - **kwargs - ).result() - def _post_double_headers_final_azure_header_get_default_initial( self, @@ -4245,15 +3881,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_azure_header_get_default.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGetDefault'} # type: ignore - def post_double_headers_final_azure_header_get_default( - self, - **kwargs # type: Any - ): - "models.Product" - return self.begin_post_double_headers_final_azure_header_get_default( - **kwargs - ).result() - def _post_async_retry_succeeded_initial( self, @@ -4370,17 +3997,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_succeeded.metadata = {'url': '/lro/postasync/retry/succeeded'} # type: ignore - def post_async_retry_succeeded( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_post_async_retry_succeeded( - product=product, - **kwargs - ).result() - def _post_async_no_retry_succeeded_initial( self, @@ -4497,17 +4113,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_no_retry_succeeded.metadata = {'url': '/lro/postasync/noretry/succeeded'} # type: ignore - def post_async_no_retry_succeeded( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_post_async_no_retry_succeeded( - product=product, - **kwargs - ).result() - def _post_async_retry_failed_initial( self, @@ -4614,17 +4219,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_failed.metadata = {'url': '/lro/postasync/retry/failed'} # type: ignore - def post_async_retry_failed( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - None - return self.begin_post_async_retry_failed( - product=product, - **kwargs - ).result() - def _post_async_retrycanceled_initial( self, @@ -4731,14 +4325,3 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retrycanceled.metadata = {'url': '/lro/postasync/retry/canceled'} # type: ignore - def post_async_retrycanceled( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - None - return self.begin_post_async_retrycanceled( - product=product, - **kwargs - ).result() - diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py index 614c371dcf5..d57a66dc7bd 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py @@ -157,17 +157,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry400.metadata = {'url': '/lro/nonretryerror/put/400'} # type: ignore - def put_non_retry400( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_non_retry400( - product=product, - **kwargs - ).result() - def _put_non_retry201_creating400_initial( self, @@ -280,17 +269,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry201_creating400.metadata = {'url': '/lro/nonretryerror/put/201/creating/400'} # type: ignore - def put_non_retry201_creating400( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_non_retry201_creating400( - product=product, - **kwargs - ).result() - def _put_non_retry201_creating400_invalid_json_initial( self, @@ -403,17 +381,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry201_creating400_invalid_json.metadata = {'url': '/lro/nonretryerror/put/201/creating/400/invalidjson'} # type: ignore - def put_non_retry201_creating400_invalid_json( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_non_retry201_creating400_invalid_json( - product=product, - **kwargs - ).result() - def _put_async_relative_retry400_initial( self, @@ -530,17 +497,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/putasync/retry/400'} # type: ignore - def put_async_relative_retry400( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_async_relative_retry400( - product=product, - **kwargs - ).result() - def _delete_non_retry400_initial( self, @@ -630,15 +586,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/400'} # type: ignore - def delete_non_retry400( - self, - **kwargs # type: Any - ): - None - return self.begin_delete_non_retry400( - **kwargs - ).result() - def _delete202_non_retry400_initial( self, @@ -728,15 +675,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/202/retry/400'} # type: ignore - def delete202_non_retry400( - self, - **kwargs # type: Any - ): - None - return self.begin_delete202_non_retry400( - **kwargs - ).result() - def _delete_async_relative_retry400_initial( self, @@ -828,15 +766,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/deleteasync/retry/400'} # type: ignore - def delete_async_relative_retry400( - self, - **kwargs # type: Any - ): - None - return self.begin_delete_async_relative_retry400( - **kwargs - ).result() - def _post_non_retry400_initial( self, @@ -940,17 +869,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_non_retry400.metadata = {'url': '/lro/nonretryerror/post/400'} # type: ignore - def post_non_retry400( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - None - return self.begin_post_non_retry400( - product=product, - **kwargs - ).result() - def _post202_non_retry400_initial( self, @@ -1054,17 +972,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_non_retry400.metadata = {'url': '/lro/nonretryerror/post/202/retry/400'} # type: ignore - def post202_non_retry400( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - None - return self.begin_post202_non_retry400( - product=product, - **kwargs - ).result() - def _post_async_relative_retry400_initial( self, @@ -1170,17 +1077,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/postasync/retry/400'} # type: ignore - def post_async_relative_retry400( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - None - return self.begin_post_async_relative_retry400( - product=product, - **kwargs - ).result() - def _put_error201_no_provisioning_state_payload_initial( self, @@ -1292,17 +1188,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_error201_no_provisioning_state_payload.metadata = {'url': '/lro/error/put/201/noprovisioningstatepayload'} # type: ignore - def put_error201_no_provisioning_state_payload( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_error201_no_provisioning_state_payload( - product=product, - **kwargs - ).result() - def _put_async_relative_retry_no_status_initial( self, @@ -1420,17 +1305,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_no_status.metadata = {'url': '/lro/error/putasync/retry/nostatus'} # type: ignore - def put_async_relative_retry_no_status( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_async_relative_retry_no_status( - product=product, - **kwargs - ).result() - def _put_async_relative_retry_no_status_payload_initial( self, @@ -1548,17 +1422,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_no_status_payload.metadata = {'url': '/lro/error/putasync/retry/nostatuspayload'} # type: ignore - def put_async_relative_retry_no_status_payload( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_async_relative_retry_no_status_payload( - product=product, - **kwargs - ).result() - def _delete204_succeeded_initial( self, @@ -1644,15 +1507,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete204_succeeded.metadata = {'url': '/lro/error/delete/204/nolocation'} # type: ignore - def delete204_succeeded( - self, - **kwargs # type: Any - ): - None - return self.begin_delete204_succeeded( - **kwargs - ).result() - def _delete_async_relative_retry_no_status_initial( self, @@ -1744,15 +1598,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_no_status.metadata = {'url': '/lro/error/deleteasync/retry/nostatus'} # type: ignore - def delete_async_relative_retry_no_status( - self, - **kwargs # type: Any - ): - None - return self.begin_delete_async_relative_retry_no_status( - **kwargs - ).result() - def _post202_no_location_initial( self, @@ -1857,17 +1702,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_no_location.metadata = {'url': '/lro/error/post/202/nolocation'} # type: ignore - def post202_no_location( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - None - return self.begin_post202_no_location( - product=product, - **kwargs - ).result() - def _post_async_relative_retry_no_payload_initial( self, @@ -1974,17 +1808,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_no_payload.metadata = {'url': '/lro/error/postasync/retry/nopayload'} # type: ignore - def post_async_relative_retry_no_payload( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - None - return self.begin_post_async_relative_retry_no_payload( - product=product, - **kwargs - ).result() - def _put200_invalid_json_initial( self, @@ -2094,17 +1917,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_invalid_json.metadata = {'url': '/lro/error/put/200/invalidjson'} # type: ignore - def put200_invalid_json( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put200_invalid_json( - product=product, - **kwargs - ).result() - def _put_async_relative_retry_invalid_header_initial( self, @@ -2222,17 +2034,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/putasync/retry/invalidheader'} # type: ignore - def put_async_relative_retry_invalid_header( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_async_relative_retry_invalid_header( - product=product, - **kwargs - ).result() - def _put_async_relative_retry_invalid_json_polling_initial( self, @@ -2350,17 +2151,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/putasync/retry/invalidjsonpolling'} # type: ignore - def put_async_relative_retry_invalid_json_polling( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - "models.Product" - return self.begin_put_async_relative_retry_invalid_json_polling( - product=product, - **kwargs - ).result() - def _delete202_retry_invalid_header_initial( self, @@ -2451,15 +2241,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry_invalid_header.metadata = {'url': '/lro/error/delete/202/retry/invalidheader'} # type: ignore - def delete202_retry_invalid_header( - self, - **kwargs # type: Any - ): - None - return self.begin_delete202_retry_invalid_header( - **kwargs - ).result() - def _delete_async_relative_retry_invalid_header_initial( self, @@ -2551,15 +2332,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/deleteasync/retry/invalidheader'} # type: ignore - def delete_async_relative_retry_invalid_header( - self, - **kwargs # type: Any - ): - None - return self.begin_delete_async_relative_retry_invalid_header( - **kwargs - ).result() - def _delete_async_relative_retry_invalid_json_polling_initial( self, @@ -2651,15 +2423,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/deleteasync/retry/invalidjsonpolling'} # type: ignore - def delete_async_relative_retry_invalid_json_polling( - self, - **kwargs # type: Any - ): - None - return self.begin_delete_async_relative_retry_invalid_json_polling( - **kwargs - ).result() - def _post202_retry_invalid_header_initial( self, @@ -2764,17 +2527,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry_invalid_header.metadata = {'url': '/lro/error/post/202/retry/invalidheader'} # type: ignore - def post202_retry_invalid_header( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - None - return self.begin_post202_retry_invalid_header( - product=product, - **kwargs - ).result() - def _post_async_relative_retry_invalid_header_initial( self, @@ -2881,17 +2633,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/postasync/retry/invalidheader'} # type: ignore - def post_async_relative_retry_invalid_header( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - None - return self.begin_post_async_relative_retry_invalid_header( - product=product, - **kwargs - ).result() - def _post_async_relative_retry_invalid_json_polling_initial( self, @@ -2998,14 +2739,3 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/postasync/retry/invalidjsonpolling'} # type: ignore - def post_async_relative_retry_invalid_json_polling( - self, - product=None, # type: Optional["models.Product"] - **kwargs # type: Any - ): - None - return self.begin_post_async_relative_retry_invalid_json_polling( - product=product, - **kwargs - ).result() - From 527f04b62333537a10f3ca0240d956af813bcd3d Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Thu, 21 May 2020 13:52:07 -0700 Subject: [PATCH 07/26] Move back lro_delay extract --- .../codegen/templates/lro_operation.py.jinja2 | 8 +- .../_lr_os_custom_header_operations_async.py | 32 +- .../_lro_retrys_operations_async.py | 56 +-- .../_lros_operations_async.py | 328 +++++++++--------- .../_lrosads_operations_async.py | 208 +++++------ .../_lr_os_custom_header_operations.py | 32 +- .../lro/operations/_lro_retrys_operations.py | 56 +-- .../Lro/lro/operations/_lros_operations.py | 328 +++++++++--------- .../Lro/lro/operations/_lrosads_operations.py | 208 +++++------ 9 files changed, 628 insertions(+), 628 deletions(-) diff --git a/autorest/codegen/templates/lro_operation.py.jinja2 b/autorest/codegen/templates/lro_operation.py.jinja2 index b21f7f8e772..f20e142f1e0 100644 --- a/autorest/codegen/templates/lro_operation.py.jinja2 +++ b/autorest/codegen/templates/lro_operation.py.jinja2 @@ -54,6 +54,10 @@ response_headers = { """ polling = kwargs.pop('polling', {{ "True" if code_model.options['azure_arm'] else "False" }}) # type: Union[bool, {{ "Async" if async_mode else "" }}PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[{{ op_tools.return_type_annotation(operation) }}] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = {{ keywords.await }}self._{{ operation.name }}_initial( @@ -81,10 +85,6 @@ response_headers = { return deserialized {% endif %} - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) {% if code_model.options['azure_arm'] %} if polling is True: polling_method = {{ async_prefix }}ARMPolling(lro_delay{{ lro_options }}, **kwargs) {% else %} diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py index bf18875907e..de41ea0100d 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py @@ -117,6 +117,10 @@ async def begin_put_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_async_retry_succeeded_initial( @@ -140,10 +144,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -234,6 +234,10 @@ async def begin_put201_creating_succeeded200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put201_creating_succeeded200_initial( @@ -252,10 +256,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -340,6 +340,10 @@ async def begin_post202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post202_retry200_initial( @@ -355,10 +359,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -445,6 +445,10 @@ async def begin_post_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post_async_retry_succeeded_initial( @@ -460,10 +464,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py index cf0588fe016..5f1781f758a 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py @@ -117,6 +117,10 @@ async def begin_put201_creating_succeeded200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put201_creating_succeeded200_initial( @@ -135,10 +139,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -227,6 +227,10 @@ async def begin_put_async_relative_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_async_relative_retry_succeeded_initial( @@ -250,10 +254,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -333,6 +333,10 @@ async def begin_delete_provisioning202_accepted200_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_provisioning202_accepted200_succeeded_initial( @@ -354,10 +358,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -428,6 +428,10 @@ async def begin_delete202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete202_retry200_initial( @@ -442,10 +446,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -517,6 +517,10 @@ async def begin_delete_async_relative_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_async_relative_retry_succeeded_initial( @@ -531,10 +535,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -618,6 +618,10 @@ async def begin_post202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post202_retry200_initial( @@ -633,10 +637,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -722,6 +722,10 @@ async def begin_post_async_relative_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post_async_relative_retry_succeeded_initial( @@ -737,10 +741,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py index 5df58915565..4b08b910623 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py @@ -113,6 +113,10 @@ async def begin_put200_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put200_succeeded_initial( @@ -131,10 +135,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -218,6 +218,10 @@ async def begin_put201_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put201_succeeded_initial( @@ -236,10 +240,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -317,6 +317,10 @@ async def begin_post202_list( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post202_list_initial( @@ -334,10 +338,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -421,6 +421,10 @@ async def begin_put200_succeeded_no_state( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put200_succeeded_no_state_initial( @@ -439,10 +443,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -527,6 +527,10 @@ async def begin_put202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put202_retry200_initial( @@ -545,10 +549,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -638,6 +638,10 @@ async def begin_put201_creating_succeeded200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put201_creating_succeeded200_initial( @@ -656,10 +660,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -744,6 +744,10 @@ async def begin_put200_updating_succeeded204( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put200_updating_succeeded204_initial( @@ -762,10 +766,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -855,6 +855,10 @@ async def begin_put201_creating_failed200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put201_creating_failed200_initial( @@ -873,10 +877,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -961,6 +961,10 @@ async def begin_put200_acceptedcanceled200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put200_acceptedcanceled200_initial( @@ -979,10 +983,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1068,6 +1068,10 @@ async def begin_put_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_no_header_in_retry_initial( @@ -1089,10 +1093,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1181,6 +1181,10 @@ async def begin_put_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_async_retry_succeeded_initial( @@ -1204,10 +1208,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1295,6 +1295,10 @@ async def begin_put_async_no_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_async_no_retry_succeeded_initial( @@ -1317,10 +1321,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1409,6 +1409,10 @@ async def begin_put_async_retry_failed( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_async_retry_failed_initial( @@ -1432,10 +1436,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1523,6 +1523,10 @@ async def begin_put_async_no_retrycanceled( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_async_no_retrycanceled_initial( @@ -1545,10 +1549,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1635,6 +1635,10 @@ async def begin_put_async_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_async_no_header_in_retry_initial( @@ -1656,10 +1660,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1742,6 +1742,10 @@ async def begin_put_non_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_non_resource_initial( @@ -1760,10 +1764,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1846,6 +1846,10 @@ async def begin_put_async_non_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_async_non_resource_initial( @@ -1864,10 +1868,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1952,6 +1952,10 @@ async def begin_put_sub_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_sub_resource_initial( @@ -1970,10 +1974,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2058,6 +2058,10 @@ async def begin_put_async_sub_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_async_sub_resource_initial( @@ -2076,10 +2080,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2159,6 +2159,10 @@ async def begin_delete_provisioning202_accepted200_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_provisioning202_accepted200_succeeded_initial( @@ -2180,10 +2184,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2263,6 +2263,10 @@ async def begin_delete_provisioning202_deleting_failed200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_provisioning202_deleting_failed200_initial( @@ -2284,10 +2288,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2367,6 +2367,10 @@ async def begin_delete_provisioning202_deletingcanceled200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_provisioning202_deletingcanceled200_initial( @@ -2388,10 +2392,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2457,6 +2457,10 @@ async def begin_delete204_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete204_succeeded_initial( @@ -2471,10 +2475,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2552,6 +2552,10 @@ async def begin_delete202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete202_retry200_initial( @@ -2569,10 +2573,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2650,6 +2650,10 @@ async def begin_delete202_no_retry204( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete202_no_retry204_initial( @@ -2667,10 +2671,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2741,6 +2741,10 @@ async def begin_delete_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_no_header_in_retry_initial( @@ -2755,10 +2759,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2829,6 +2829,10 @@ async def begin_delete_async_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_async_no_header_in_retry_initial( @@ -2843,10 +2847,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2918,6 +2918,10 @@ async def begin_delete_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_async_retry_succeeded_initial( @@ -2932,10 +2936,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -3007,6 +3007,10 @@ async def begin_delete_async_no_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_async_no_retry_succeeded_initial( @@ -3021,10 +3025,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -3096,6 +3096,10 @@ async def begin_delete_async_retry_failed( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_async_retry_failed_initial( @@ -3110,10 +3114,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -3185,6 +3185,10 @@ async def begin_delete_async_retrycanceled( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_async_retrycanceled_initial( @@ -3199,10 +3203,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -3278,6 +3278,10 @@ async def begin_post200_with_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post200_with_payload_initial( @@ -3295,10 +3299,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -3382,6 +3382,10 @@ async def begin_post202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post202_retry200_initial( @@ -3397,10 +3401,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -3487,6 +3487,10 @@ async def begin_post202_no_retry204( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post202_no_retry204_initial( @@ -3509,10 +3513,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -3584,6 +3584,10 @@ async def begin_post_double_headers_final_location_get( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post_double_headers_final_location_get_initial( @@ -3601,10 +3605,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -3676,6 +3676,10 @@ async def begin_post_double_headers_final_azure_header_get( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post_double_headers_final_azure_header_get_initial( @@ -3693,10 +3697,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -3768,6 +3768,10 @@ async def begin_post_double_headers_final_azure_header_get_default( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post_double_headers_final_azure_header_get_default_initial( @@ -3785,10 +3789,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -3881,6 +3881,10 @@ async def begin_post_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post_async_retry_succeeded_initial( @@ -3899,10 +3903,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -3995,6 +3995,10 @@ async def begin_post_async_no_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post_async_no_retry_succeeded_initial( @@ -4013,10 +4017,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -4102,6 +4102,10 @@ async def begin_post_async_retry_failed( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post_async_retry_failed_initial( @@ -4117,10 +4121,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -4206,6 +4206,10 @@ async def begin_post_async_retrycanceled( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post_async_retrycanceled_initial( @@ -4221,10 +4225,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py index 3aed379ac50..2e0613bd0a7 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py @@ -115,6 +115,10 @@ async def begin_put_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_non_retry400_initial( @@ -133,10 +137,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -225,6 +225,10 @@ async def begin_put_non_retry201_creating400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_non_retry201_creating400_initial( @@ -243,10 +247,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -335,6 +335,10 @@ async def begin_put_non_retry201_creating400_invalid_json( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_non_retry201_creating400_invalid_json_initial( @@ -353,10 +357,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -444,6 +444,10 @@ async def begin_put_async_relative_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_async_relative_retry400_initial( @@ -467,10 +471,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -540,6 +540,10 @@ async def begin_delete_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_non_retry400_initial( @@ -554,10 +558,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -627,6 +627,10 @@ async def begin_delete202_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete202_non_retry400_initial( @@ -641,10 +645,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -716,6 +716,10 @@ async def begin_delete_async_relative_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_async_relative_retry400_initial( @@ -730,10 +734,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -816,6 +816,10 @@ async def begin_post_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post_non_retry400_initial( @@ -831,10 +835,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -917,6 +917,10 @@ async def begin_post202_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post202_non_retry400_initial( @@ -932,10 +936,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1020,6 +1020,10 @@ async def begin_post_async_relative_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post_async_relative_retry400_initial( @@ -1035,10 +1039,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1126,6 +1126,10 @@ async def begin_put_error201_no_provisioning_state_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_error201_no_provisioning_state_payload_initial( @@ -1144,10 +1148,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1236,6 +1236,10 @@ async def begin_put_async_relative_retry_no_status( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_async_relative_retry_no_status_initial( @@ -1259,10 +1263,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1351,6 +1351,10 @@ async def begin_put_async_relative_retry_no_status_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_async_relative_retry_no_status_payload_initial( @@ -1374,10 +1378,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1443,6 +1443,10 @@ async def begin_delete204_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete204_succeeded_initial( @@ -1457,10 +1461,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1532,6 +1532,10 @@ async def begin_delete_async_relative_retry_no_status( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_async_relative_retry_no_status_initial( @@ -1546,10 +1550,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1633,6 +1633,10 @@ async def begin_post202_no_location( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post202_no_location_initial( @@ -1648,10 +1652,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1737,6 +1737,10 @@ async def begin_post_async_relative_retry_no_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post_async_relative_retry_no_payload_initial( @@ -1752,10 +1756,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1841,6 +1841,10 @@ async def begin_put200_invalid_json( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put200_invalid_json_initial( @@ -1859,10 +1863,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -1951,6 +1951,10 @@ async def begin_put_async_relative_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_async_relative_retry_invalid_header_initial( @@ -1974,10 +1978,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2066,6 +2066,10 @@ async def begin_put_async_relative_retry_invalid_json_polling( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._put_async_relative_retry_invalid_json_polling_initial( @@ -2089,10 +2093,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2163,6 +2163,10 @@ async def begin_delete202_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete202_retry_invalid_header_initial( @@ -2177,10 +2181,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2252,6 +2252,10 @@ async def begin_delete_async_relative_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_async_relative_retry_invalid_header_initial( @@ -2266,10 +2270,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2341,6 +2341,10 @@ async def begin_delete_async_relative_retry_invalid_json_polling( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_async_relative_retry_invalid_json_polling_initial( @@ -2355,10 +2359,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2442,6 +2442,10 @@ async def begin_post202_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post202_retry_invalid_header_initial( @@ -2457,10 +2461,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2546,6 +2546,10 @@ async def begin_post_async_relative_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post_async_relative_retry_invalid_header_initial( @@ -2561,10 +2565,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling @@ -2650,6 +2650,10 @@ async def begin_post_async_relative_retry_invalid_json_polling( """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = await self._post_async_relative_retry_invalid_json_polling_initial( @@ -2665,10 +2669,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py index d202b1424e7..ffb9feb39e1 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py @@ -123,6 +123,10 @@ def begin_put_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_async_retry_succeeded_initial( @@ -146,10 +150,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -242,6 +242,10 @@ def begin_put201_creating_succeeded200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put201_creating_succeeded200_initial( @@ -260,10 +264,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -350,6 +350,10 @@ def begin_post202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post202_retry200_initial( @@ -365,10 +369,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -457,6 +457,10 @@ def begin_post_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post_async_retry_succeeded_initial( @@ -472,10 +476,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py index c6e619ace7f..e144a049e31 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py @@ -123,6 +123,10 @@ def begin_put201_creating_succeeded200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put201_creating_succeeded200_initial( @@ -141,10 +145,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -235,6 +235,10 @@ def begin_put_async_relative_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_async_relative_retry_succeeded_initial( @@ -258,10 +262,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -343,6 +343,10 @@ def begin_delete_provisioning202_accepted200_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_provisioning202_accepted200_succeeded_initial( @@ -364,10 +368,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -440,6 +440,10 @@ def begin_delete202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete202_retry200_initial( @@ -454,10 +458,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -531,6 +531,10 @@ def begin_delete_async_relative_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_async_relative_retry_succeeded_initial( @@ -545,10 +549,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -634,6 +634,10 @@ def begin_post202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post202_retry200_initial( @@ -649,10 +653,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -740,6 +740,10 @@ def begin_post_async_relative_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post_async_relative_retry_succeeded_initial( @@ -755,10 +759,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py index 612b4752087..623d81f8851 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py @@ -119,6 +119,10 @@ def begin_put200_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put200_succeeded_initial( @@ -137,10 +141,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -226,6 +226,10 @@ def begin_put201_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put201_succeeded_initial( @@ -244,10 +248,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -327,6 +327,10 @@ def begin_post202_list( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post202_list_initial( @@ -344,10 +348,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -433,6 +433,10 @@ def begin_put200_succeeded_no_state( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put200_succeeded_no_state_initial( @@ -451,10 +455,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -541,6 +541,10 @@ def begin_put202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put202_retry200_initial( @@ -559,10 +563,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -654,6 +654,10 @@ def begin_put201_creating_succeeded200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put201_creating_succeeded200_initial( @@ -672,10 +676,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -762,6 +762,10 @@ def begin_put200_updating_succeeded204( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put200_updating_succeeded204_initial( @@ -780,10 +784,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -875,6 +875,10 @@ def begin_put201_creating_failed200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put201_creating_failed200_initial( @@ -893,10 +897,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -983,6 +983,10 @@ def begin_put200_acceptedcanceled200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put200_acceptedcanceled200_initial( @@ -1001,10 +1005,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1092,6 +1092,10 @@ def begin_put_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_no_header_in_retry_initial( @@ -1113,10 +1117,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1207,6 +1207,10 @@ def begin_put_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_async_retry_succeeded_initial( @@ -1230,10 +1234,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1323,6 +1323,10 @@ def begin_put_async_no_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_async_no_retry_succeeded_initial( @@ -1345,10 +1349,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1439,6 +1439,10 @@ def begin_put_async_retry_failed( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_async_retry_failed_initial( @@ -1462,10 +1466,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1555,6 +1555,10 @@ def begin_put_async_no_retrycanceled( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_async_no_retrycanceled_initial( @@ -1577,10 +1581,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1669,6 +1669,10 @@ def begin_put_async_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_async_no_header_in_retry_initial( @@ -1690,10 +1694,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1778,6 +1778,10 @@ def begin_put_non_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_non_resource_initial( @@ -1796,10 +1800,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1884,6 +1884,10 @@ def begin_put_async_non_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_async_non_resource_initial( @@ -1902,10 +1906,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1992,6 +1992,10 @@ def begin_put_sub_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_sub_resource_initial( @@ -2010,10 +2014,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2100,6 +2100,10 @@ def begin_put_async_sub_resource( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.SubProduct"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_async_sub_resource_initial( @@ -2118,10 +2122,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2203,6 +2203,10 @@ def begin_delete_provisioning202_accepted200_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_provisioning202_accepted200_succeeded_initial( @@ -2224,10 +2228,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2309,6 +2309,10 @@ def begin_delete_provisioning202_deleting_failed200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_provisioning202_deleting_failed200_initial( @@ -2330,10 +2334,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2415,6 +2415,10 @@ def begin_delete_provisioning202_deletingcanceled200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_provisioning202_deletingcanceled200_initial( @@ -2436,10 +2440,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2507,6 +2507,10 @@ def begin_delete204_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete204_succeeded_initial( @@ -2521,10 +2525,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2604,6 +2604,10 @@ def begin_delete202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete202_retry200_initial( @@ -2621,10 +2625,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2704,6 +2704,10 @@ def begin_delete202_no_retry204( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete202_no_retry204_initial( @@ -2721,10 +2725,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2797,6 +2797,10 @@ def begin_delete_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_no_header_in_retry_initial( @@ -2811,10 +2815,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2887,6 +2887,10 @@ def begin_delete_async_no_header_in_retry( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_async_no_header_in_retry_initial( @@ -2901,10 +2905,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2978,6 +2978,10 @@ def begin_delete_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_async_retry_succeeded_initial( @@ -2992,10 +2996,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -3069,6 +3069,10 @@ def begin_delete_async_no_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_async_no_retry_succeeded_initial( @@ -3083,10 +3087,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -3160,6 +3160,10 @@ def begin_delete_async_retry_failed( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_async_retry_failed_initial( @@ -3174,10 +3178,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -3251,6 +3251,10 @@ def begin_delete_async_retrycanceled( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_async_retrycanceled_initial( @@ -3265,10 +3269,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -3346,6 +3346,10 @@ def begin_post200_with_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Sku"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post200_with_payload_initial( @@ -3363,10 +3367,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -3452,6 +3452,10 @@ def begin_post202_retry200( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post202_retry200_initial( @@ -3467,10 +3471,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -3559,6 +3559,10 @@ def begin_post202_no_retry204( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post202_no_retry204_initial( @@ -3581,10 +3585,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -3658,6 +3658,10 @@ def begin_post_double_headers_final_location_get( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post_double_headers_final_location_get_initial( @@ -3675,10 +3679,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -3752,6 +3752,10 @@ def begin_post_double_headers_final_azure_header_get( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post_double_headers_final_azure_header_get_initial( @@ -3769,10 +3773,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -3846,6 +3846,10 @@ def begin_post_double_headers_final_azure_header_get_default( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post_double_headers_final_azure_header_get_default_initial( @@ -3863,10 +3867,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -3961,6 +3961,10 @@ def begin_post_async_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post_async_retry_succeeded_initial( @@ -3979,10 +3983,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -4077,6 +4077,10 @@ def begin_post_async_no_retry_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post_async_no_retry_succeeded_initial( @@ -4095,10 +4099,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -4186,6 +4186,10 @@ def begin_post_async_retry_failed( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post_async_retry_failed_initial( @@ -4201,10 +4205,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -4292,6 +4292,10 @@ def begin_post_async_retrycanceled( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post_async_retrycanceled_initial( @@ -4307,10 +4311,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py index d57a66dc7bd..477f340c163 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py @@ -121,6 +121,10 @@ def begin_put_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_non_retry400_initial( @@ -139,10 +143,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -233,6 +233,10 @@ def begin_put_non_retry201_creating400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_non_retry201_creating400_initial( @@ -251,10 +255,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -345,6 +345,10 @@ def begin_put_non_retry201_creating400_invalid_json( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_non_retry201_creating400_invalid_json_initial( @@ -363,10 +367,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -456,6 +456,10 @@ def begin_put_async_relative_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_async_relative_retry400_initial( @@ -479,10 +483,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -554,6 +554,10 @@ def begin_delete_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_non_retry400_initial( @@ -568,10 +572,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -643,6 +643,10 @@ def begin_delete202_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete202_non_retry400_initial( @@ -657,10 +661,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -734,6 +734,10 @@ def begin_delete_async_relative_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_async_relative_retry400_initial( @@ -748,10 +752,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -836,6 +836,10 @@ def begin_post_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post_non_retry400_initial( @@ -851,10 +855,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -939,6 +939,10 @@ def begin_post202_non_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post202_non_retry400_initial( @@ -954,10 +958,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1044,6 +1044,10 @@ def begin_post_async_relative_retry400( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post_async_relative_retry400_initial( @@ -1059,10 +1063,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1152,6 +1152,10 @@ def begin_put_error201_no_provisioning_state_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_error201_no_provisioning_state_payload_initial( @@ -1170,10 +1174,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1264,6 +1264,10 @@ def begin_put_async_relative_retry_no_status( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_async_relative_retry_no_status_initial( @@ -1287,10 +1291,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1381,6 +1381,10 @@ def begin_put_async_relative_retry_no_status_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_async_relative_retry_no_status_payload_initial( @@ -1404,10 +1408,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1475,6 +1475,10 @@ def begin_delete204_succeeded( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete204_succeeded_initial( @@ -1489,10 +1493,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1566,6 +1566,10 @@ def begin_delete_async_relative_retry_no_status( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_async_relative_retry_no_status_initial( @@ -1580,10 +1584,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1669,6 +1669,10 @@ def begin_post202_no_location( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post202_no_location_initial( @@ -1684,10 +1688,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1775,6 +1775,10 @@ def begin_post_async_relative_retry_no_payload( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post_async_relative_retry_no_payload_initial( @@ -1790,10 +1794,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1881,6 +1881,10 @@ def begin_put200_invalid_json( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put200_invalid_json_initial( @@ -1899,10 +1903,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -1993,6 +1993,10 @@ def begin_put_async_relative_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_async_relative_retry_invalid_header_initial( @@ -2016,10 +2020,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2110,6 +2110,10 @@ def begin_put_async_relative_retry_invalid_json_polling( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["models.Product"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._put_async_relative_retry_invalid_json_polling_initial( @@ -2133,10 +2137,6 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, response_headers) return deserialized - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2209,6 +2209,10 @@ def begin_delete202_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete202_retry_invalid_header_initial( @@ -2223,10 +2227,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2300,6 +2300,10 @@ def begin_delete_async_relative_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_async_relative_retry_invalid_header_initial( @@ -2314,10 +2318,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2391,6 +2391,10 @@ def begin_delete_async_relative_retry_invalid_json_polling( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._delete_async_relative_retry_invalid_json_polling_initial( @@ -2405,10 +2409,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2494,6 +2494,10 @@ def begin_post202_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post202_retry_invalid_header_initial( @@ -2509,10 +2513,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2600,6 +2600,10 @@ def begin_post_async_relative_retry_invalid_header( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post_async_relative_retry_invalid_header_initial( @@ -2615,10 +2619,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling @@ -2706,6 +2706,10 @@ def begin_post_async_relative_retry_invalid_json_polling( """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: raw_result = self._post_async_relative_retry_invalid_json_polling_initial( @@ -2721,10 +2725,6 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling From 47962432a0c9135b9bcb00f6f3a95e2a7d324028 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Thu, 21 May 2020 14:40:15 -0700 Subject: [PATCH 08/26] Update tests to begin_ in async --- .../AcceptanceTests/asynctests/test_lro.py | 181 +++++++++--------- 1 file changed, 93 insertions(+), 88 deletions(-) diff --git a/test/azure/AcceptanceTests/asynctests/test_lro.py b/test/azure/AcceptanceTests/asynctests/test_lro.py index 0834e22bf66..89dd23404d5 100644 --- a/test/azure/AcceptanceTests/asynctests/test_lro.py +++ b/test/azure/AcceptanceTests/asynctests/test_lro.py @@ -30,10 +30,10 @@ import isodate import tempfile import json -import time from uuid import uuid4 from datetime import date, datetime, timedelta import os +import time from os.path import dirname, pardir, join, realpath from azure.core.exceptions import DecodeError, HttpResponseError @@ -129,7 +129,7 @@ async def assert_raises_with_message(self, msg, func, *args, **kwargs): async def lro_result(self, func, *args, **kwargs): if "polling" not in kwargs: kwargs["polling"] = AutorestTestARMPolling(0) - return await func(*args, **kwargs) + return await (await func(*args, **kwargs)).result() @pytest.mark.asyncio async def test_post_double_headers_final(self, client): @@ -137,85 +137,86 @@ async def test_post_double_headers_final(self, client): continuation_token = poller.continuation_token() poller = await client.lros.begin_post_double_headers_final_location_get(continuation_token=continuation_token) - product = await poller + product = await poller.result() assert product.id == "100" @pytest.mark.asyncio async def test_post_double_headers_default(self, client): # This test will work as long as the default is Location - product = await client.lros.post_double_headers_final_azure_header_get_default() + poller = await client.lros.begin_post_double_headers_final_azure_header_get_default() + product = await poller.result() assert product.id == "100" @pytest.mark.asyncio async def test_happy_put201_creating_succeeded200(self, client, product): - process = await self.lro_result(client.lros.put201_creating_succeeded200, product) + process = await self.lro_result(client.lros.begin_put201_creating_succeeded200, product) assert "Succeeded" == process.provisioning_state # Testing nopolling - process = await self.lro_result(client.lros.put201_creating_succeeded200, product, polling=False) + process = await self.lro_result(client.lros.begin_put201_creating_succeeded200, product, polling=False) assert "Creating" == process.provisioning_state @pytest.mark.asyncio async def test_happy_put201_creating_failed200(self, client, product): await self.assert_raises_with_message( ("Operation returned an invalid status 'OK'", "failed"), - client.lros.put201_creating_failed200, product) + client.lros.begin_put201_creating_failed200, product) - process = await self.lro_result(client.lros.put201_creating_failed200, product, polling=False) + process = await self.lro_result(client.lros.begin_put201_creating_failed200, product, polling=False) assert "Created" == process.provisioning_state @pytest.mark.asyncio async def test_happy_put200_updating_succeeded204(self, client, product): - process = await self.lro_result(client.lros.put200_updating_succeeded204, product) + process = await self.lro_result(client.lros.begin_put200_updating_succeeded204, product) assert "Succeeded" == process.provisioning_state - process = await self.lro_result(client.lros.put200_updating_succeeded204, product, polling=False) + process = await self.lro_result(client.lros.begin_put200_updating_succeeded204, product, polling=False) assert "Updating" == process.provisioning_state @pytest.mark.asyncio async def test_happy_put200_acceptedcanceled200(self, client, product): await self.assert_raises_with_message( ("Operation returned an invalid status 'OK'", "canceled"), - client.lros.put200_acceptedcanceled200, product) + client.lros.begin_put200_acceptedcanceled200, product) - process = await self.lro_result(client.lros.put200_acceptedcanceled200, product, polling=False) + process = await self.lro_result(client.lros.begin_put200_acceptedcanceled200, product, polling=False) assert "Accepted" == process.provisioning_state @pytest.mark.asyncio async def test_happy_put_no_header_in_retry(self, client, product): - process = await self.lro_result(client.lros.put_no_header_in_retry, product) + process = await self.lro_result(client.lros.begin_put_no_header_in_retry, product) assert "Succeeded" == process.provisioning_state - process = await self.lro_result(client.lros.put_async_no_header_in_retry, product) + process = await self.lro_result(client.lros.begin_put_async_no_header_in_retry, product) assert "Succeeded" == process.provisioning_state @pytest.mark.asyncio async def test_happy_put_sub_resource(self, client): - process = await self.lro_result(client.lros.put_sub_resource, SubProduct()) + process = await self.lro_result(client.lros.begin_put_sub_resource, SubProduct()) assert "Succeeded" == process.provisioning_state - process = await self.lro_result(client.lros.put_async_sub_resource, SubProduct()) + process = await self.lro_result(client.lros.begin_put_async_sub_resource, SubProduct()) assert "Succeeded" == process.provisioning_state @pytest.mark.asyncio async def test_happy_put_non_resource(self, client): - process = await self.lro_result(client.lros.put_non_resource, Sku()) + process = await self.lro_result(client.lros.begin_put_non_resource, Sku()) assert "100" == process.id - process = await self.lro_result(client.lros.put_async_non_resource, Sku()) + process = await self.lro_result(client.lros.begin_put_async_non_resource, Sku()) assert "100" == process.id @pytest.mark.asyncio async def test_happy_put200_succeeded(self, client, product): - process = await self.lro_result(client.lros.put200_succeeded, product) + process = await self.lro_result(client.lros.begin_put200_succeeded, product) assert "Succeeded" == process.provisioning_state - process = await self.lro_result(client.lros.put200_succeeded_no_state, product) + process = await self.lro_result(client.lros.begin_put200_succeeded_no_state, product) assert "100" == process.id @pytest.mark.asyncio async def test_put201_succeeded(self, client, product): - process = await self.lro_result(client.lros.put201_succeeded, product) + process = await self.lro_result(client.lros.begin_put201_succeeded, product) assert "Succeeded" == process.provisioning_state assert "100" == process.id @@ -223,256 +224,258 @@ async def test_put201_succeeded(self, client, product): @pytest.mark.asyncio async def test_happy_put202_retry200(self, client, product): - process = await self.lro_result(client.lros.put202_retry200, product) + process = await self.lro_result(client.lros.begin_put202_retry200, product) assert "100" == process.id @pytest.mark.asyncio async def test_happy_put_retry_succeeded(self, client, product): - process = await self.lro_result(client.lros.put_async_retry_succeeded, product) + process = await self.lro_result(client.lros.begin_put_async_retry_succeeded, product) assert "Succeeded" == process.provisioning_state - process = await self.lro_result(client.lros.put_async_no_retry_succeeded, product) + process = await self.lro_result(client.lros.begin_put_async_no_retry_succeeded, product) assert "Succeeded" == process.provisioning_state @pytest.mark.asyncio async def test_happy_put_retry_failed_canceled(self, client, product): await self.assert_raises_with_message( ("Operation returned an invalid status 'OK'", "failed"), - client.lros.put_async_retry_failed, product) + client.lros.begin_put_async_retry_failed, product) await self.assert_raises_with_message( ("Operation returned an invalid status 'OK'", "canceled"), - client.lros.put_async_no_retrycanceled, product) + client.lros.begin_put_async_no_retrycanceled, product) @pytest.mark.asyncio async def test_post202_retry200(self, client, product): - process = await self.lro_result(client.lros.post202_retry200, product) + process = await self.lro_result(client.lros.begin_post202_retry200, product) assert process is None @pytest.mark.asyncio async def test_happy_delete(self, client): - assert await self.lro_result(client.lros.delete204_succeeded) is None - assert await self.lro_result(client.lros.delete202_retry200) is None - assert await self.lro_result(client.lros.delete202_no_retry204) is None + assert await self.lro_result(client.lros.begin_delete204_succeeded) is None + assert await self.lro_result(client.lros.begin_delete202_retry200) is None + assert await self.lro_result(client.lros.begin_delete202_no_retry204) is None @pytest.mark.asyncio async def test_happy_delete_no_header_in_retry(self, client): - assert await self.lro_result(client.lros.delete_no_header_in_retry) is None - assert await self.lro_result(client.lros.delete_async_no_header_in_retry) is None + assert await self.lro_result(client.lros.begin_delete_no_header_in_retry) is None + assert await self.lro_result(client.lros.begin_delete_async_no_header_in_retry) is None @pytest.mark.asyncio async def test_happy_delete_async_retry_failed_canceled(self, client): await self.assert_raises_with_message( ("Operation returned an invalid status 'OK'", "canceled"), - client.lros.delete_async_retrycanceled) + client.lros.begin_delete_async_retrycanceled) await self.assert_raises_with_message( ("Operation returned an invalid status 'OK'", "failed"), - client.lros.delete_async_retry_failed) + client.lros.begin_delete_async_retry_failed) @pytest.mark.asyncio async def test_happy_delete_async_succeeded(self, client): - assert await self.lro_result(client.lros.delete_async_no_retry_succeeded) is None - assert await self.lro_result(client.lros.delete_async_retry_succeeded) is None + assert await self.lro_result(client.lros.begin_delete_async_no_retry_succeeded) is None + assert await self.lro_result(client.lros.begin_delete_async_retry_succeeded) is None @pytest.mark.asyncio async def test_happy_delete_provisioning(self, client): - process = await self.lro_result(client.lros.delete_provisioning202_accepted200_succeeded) + process = await self.lro_result(client.lros.begin_delete_provisioning202_accepted200_succeeded) assert "Succeeded" == process.provisioning_state - result = await self.lro_result(client.lros.delete_provisioning202_deletingcanceled200) + result = await self.lro_result(client.lros.begin_delete_provisioning202_deletingcanceled200) assert result.provisioning_state == 'Canceled' - result = await self.lro_result(client.lros.delete_provisioning202_deleting_failed200) + result = await self.lro_result(client.lros.begin_delete_provisioning202_deleting_failed200) assert result.provisioning_state == 'Failed' @pytest.mark.asyncio async def test_happy_post(self, client, product): - assert await self.lro_result(client.lros.post202_no_retry204, product) is None + assert await self.lro_result(client.lros.begin_post202_no_retry204, product) is None - sku = await self.lro_result(client.lros.post200_with_payload) + sku = await self.lro_result(client.lros.begin_post200_with_payload) assert sku.id == '1' @pytest.mark.asyncio async def test_happy_post_async_retry_failed_canceled(self, client, product): await self.assert_raises_with_message("Internal Server Error", - client.lros.post_async_retry_failed) + client.lros.begin_post_async_retry_failed) await self.assert_raises_with_message( ("Operation returned an invalid status 'OK'", "canceled"), - client.lros.post_async_retrycanceled) + client.lros.begin_post_async_retrycanceled) @pytest.mark.asyncio async def test_happy_post_async_succeeded(self, client, product): - prod = await self.lro_result(client.lros.post_async_retry_succeeded) + prod = await self.lro_result(client.lros.begin_post_async_retry_succeeded) assert prod.id == "100" - prod = await self.lro_result(client.lros.post_async_no_retry_succeeded) + prod = await self.lro_result(client.lros.begin_post_async_no_retry_succeeded) assert prod.id == "100" @pytest.mark.asyncio async def test_retrys_put(self, client, product): - process = await self.lro_result(client.lro_retrys.put201_creating_succeeded200, product) + process = await self.lro_result(client.lro_retrys.begin_put201_creating_succeeded200, product) assert 'Succeeded' == process.provisioning_state - process = await self.lro_result(client.lro_retrys.put_async_relative_retry_succeeded, product) + process = await self.lro_result(client.lro_retrys.begin_put_async_relative_retry_succeeded, product) assert 'Succeeded' == process.provisioning_state @pytest.mark.asyncio async def test_retrys_delete(self, client, product): - process = await self.lro_result(client.lro_retrys.delete_provisioning202_accepted200_succeeded) + process = await self.lro_result(client.lro_retrys.begin_delete_provisioning202_accepted200_succeeded) assert 'Succeeded' == process.provisioning_state - assert await self.lro_result(client.lro_retrys.delete202_retry200) is None - assert await self.lro_result(client.lro_retrys.delete_async_relative_retry_succeeded) is None + assert await self.lro_result(client.lro_retrys.begin_delete202_retry200) is None + assert await self.lro_result(client.lro_retrys.begin_delete_async_relative_retry_succeeded) is None @pytest.mark.asyncio async def test_retrys_post(self, client, product): - assert await self.lro_result(client.lro_retrys.post202_retry200, product) is None - assert await self.lro_result(client.lro_retrys.post_async_relative_retry_succeeded, product) is None + assert await self.lro_result(client.lro_retrys.begin_post202_retry200, product) is None + assert await self.lro_result(client.lro_retrys.begin_post_async_relative_retry_succeeded, product) is None @pytest.mark.asyncio async def test_custom_headers_put_async_retry_succeeded(self, client, product, custom_headers): - process = await self.lro_result(client.lr_os_custom_header.put_async_retry_succeeded, product, headers=custom_headers) + process = await self.lro_result(client.lr_os_custom_header.begin_put_async_retry_succeeded, product, headers=custom_headers) assert process is not None @pytest.mark.asyncio async def test_custom_headers_post_async_retry_succeeded(self, client, product, custom_headers): - process = await self.lro_result(client.lr_os_custom_header.post_async_retry_succeeded, product, headers=custom_headers) + process = await self.lro_result(client.lr_os_custom_header.begin_post_async_retry_succeeded, product, headers=custom_headers) assert process is None @pytest.mark.asyncio async def test_custom_headers_put201_creating_succeeded200(self, client, product, custom_headers): - process = await self.lro_result(client.lr_os_custom_header.put201_creating_succeeded200, product, headers=custom_headers) + process = await self.lro_result(client.lr_os_custom_header.begin_put201_creating_succeeded200, product, headers=custom_headers) assert process is not None @pytest.mark.asyncio async def test_custom_headers_post202_retry200(self, client, product, custom_headers): - process = await self.lro_result(client.lr_os_custom_header.post202_retry200, product, headers=custom_headers) + process = await self.lro_result(client.lr_os_custom_header.begin_post202_retry200, product, headers=custom_headers) assert process is None @pytest.mark.asyncio async def test_sads_put_non_retry(self, client, product): await self.assert_raises_with_message("Bad Request", - client.lrosads.put_non_retry400, product) + client.lrosads.begin_put_non_retry400, product) await self.assert_raises_with_message("Error from the server", - client.lrosads.put_non_retry201_creating400, product) + client.lrosads.begin_put_non_retry201_creating400, product) @pytest.mark.asyncio async def test_sads_put_async_relative(self, client, product): await self.assert_raises_with_message("Operation returned an invalid status 'Bad Request'", - client.lrosads.put_async_relative_retry400, product) + client.lrosads.begin_put_async_relative_retry400, product) await self.assert_raises_with_message("no status found in body", - client.lrosads.put_async_relative_retry_no_status, product) + client.lrosads.begin_put_async_relative_retry_no_status, product) await self.assert_raises_with_message("The response from long running operation does not contain a body.", - client.lrosads.put_async_relative_retry_no_status_payload, product) + client.lrosads.begin_put_async_relative_retry_no_status_payload, product) @pytest.mark.asyncio async def test_sads_put_error201_no_provisioning_state_payload(self, client, product): await self.assert_raises_with_message("The response from long running operation does not contain a body.", - client.lrosads.put_error201_no_provisioning_state_payload, product) + client.lrosads.begin_put_error201_no_provisioning_state_payload, product) @pytest.mark.asyncio async def test_sads_put200_invalid_json_with_exception(self, client, product): with pytest.raises(DecodeError): - await self.lro_result(client.lrosads.put200_invalid_json, product) + await self.lro_result(client.lrosads.begin_put200_invalid_json, product) @pytest.mark.asyncio async def test_sads_put_async_relative_with_exception(self, client, product): with pytest.raises(DecodeError): - await self.lro_result(client.lrosads.put_async_relative_retry_invalid_json_polling, product) + await self.lro_result(client.lrosads.begin_put_async_relative_retry_invalid_json_polling, product) with pytest.raises(Exception): - await self.lro_result(client.lrosads.put_async_relative_retry_invalid_header, product) + await self.lro_result(client.lrosads.begin_put_async_relative_retry_invalid_header, product) @pytest.mark.asyncio async def test_sads_put_non_retry201_creating400_invalid_json_with_exception(self, client, product): with pytest.raises(DecodeError): - await self.lro_result(client.lrosads.put_non_retry201_creating400_invalid_json, product) + await self.lro_result(client.lrosads.begin_put_non_retry201_creating400_invalid_json, product) @pytest.mark.asyncio async def tests_lro_sads_delete_non_retry(self, client, product): await self.assert_raises_with_message("Bad Request", - client.lrosads.delete_non_retry400) + client.lrosads.begin_delete_non_retry400) await self.assert_raises_with_message("Bad Request", - client.lrosads.delete202_non_retry400) + client.lrosads.begin_delete202_non_retry400) @pytest.mark.asyncio async def test_sads_delete_async_relative(self, client, product): await self.assert_raises_with_message("Bad Request", - client.lrosads.delete_async_relative_retry400) + client.lrosads.begin_delete_async_relative_retry400) await self.assert_raises_with_message("no status found in body", - client.lrosads.delete_async_relative_retry_no_status) + client.lrosads.begin_delete_async_relative_retry_no_status) @pytest.mark.asyncio async def test_sads_delete204_succeeded(self, client): - await self.lro_result(client.lrosads.delete204_succeeded) + await self.lro_result(client.lrosads.begin_delete204_succeeded) @pytest.mark.asyncio async def test_sads_delete_async_relative_with_exception(self, client): with pytest.raises(Exception): - await self.lro_result(client.lrosads.delete_async_relative_retry_invalid_header) + await self.lro_result(client.lrosads.begin_delete_async_relative_retry_invalid_header) with pytest.raises(DecodeError): - await self.lro_result(client.lrosads.delete_async_relative_retry_invalid_json_polling) + await self.lro_result(client.lrosads.begin_delete_async_relative_retry_invalid_json_polling) @pytest.mark.asyncio async def test_sads_delete202_retry_invalid_header_with_exception(self, client): with pytest.raises(Exception): - await self.lro_result(client.lrosads.delete202_retry_invalid_header) + await self.lro_result(client.lrosads.begin_delete202_retry_invalid_header) @pytest.mark.asyncio async def test_sads_post_non_retry(self, client, product): await self.assert_raises_with_message("Bad Request", - client.lrosads.post_non_retry400, product) + client.lrosads.begin_post_non_retry400, product) await self.assert_raises_with_message("Bad Request", - client.lrosads.post202_non_retry400, product) + client.lrosads.begin_post202_non_retry400, product) @pytest.mark.asyncio async def test_sads_post_async_relative(self, client, product): await self.assert_raises_with_message("Bad Request", - client.lrosads.post_async_relative_retry400, product) + client.lrosads.begin_post_async_relative_retry400, product) await self.assert_raises_with_message("The response from long running operation does not contain a body.", - client.lrosads.post_async_relative_retry_no_payload) + client.lrosads.begin_post_async_relative_retry_no_payload) @pytest.mark.asyncio async def test_sads_post202_no_location(self, client): # Testserver wants us to fail (coverage name is LROErrorPostNoLocation) # Actually, Python will NOT, and consider any kind of success 2xx on the initial call # is an actual success - process = await self.lro_result(client.lrosads.post202_no_location) + process = await self.lro_result(client.lrosads.begin_post202_no_location) assert process is None @pytest.mark.asyncio async def test_sads_post_async_relative_with_exception(self, client): with pytest.raises(Exception): - await self.lro_result(client.lrosads.post_async_relative_retry_invalid_header) + await self.lro_result(client.lrosads.begin_post_async_relative_retry_invalid_header) with pytest.raises(DecodeError): - await self.lro_result(client.lrosads.post_async_relative_retry_invalid_json_polling) + await self.lro_result(client.lrosads.begin_post_async_relative_retry_invalid_json_polling) @pytest.mark.asyncio async def test_post202_retry_invalid_header_with_exception(self, client): with pytest.raises(Exception): - await self.lro_result(client.lrosads.post202_retry_invalid_header) + await self.lro_result(client.lrosads.begin_post202_retry_invalid_header) @pytest.mark.asyncio async def test_polling_interval_operation(self, client): default_polling_interval_start_time = time.time() - product1 = await client.lros.post_double_headers_final_azure_header_get_default() + poller = await client.lros.begin_post_double_headers_final_azure_header_get_default() + product1 = await poller.result() default_polling_interval_duration = time.time() - default_polling_interval_start_time assert abs(default_polling_interval_duration - 0) < 0.1 one_second_polling_interval_start_time = time.time() - product2 = await client.lros.post_double_headers_final_azure_header_get_default(polling_interval=1) + poller = await client.lros.begin_post_double_headers_final_azure_header_get_default(polling_interval=1) + product2 = await poller.result() one_second_polling_interval_duration = time.time() - one_second_polling_interval_start_time assert abs(one_second_polling_interval_duration - 1) < 0.1 @@ -481,7 +484,8 @@ async def test_polling_interval_operation(self, client): @pytest.mark.asyncio async def test_polling_interval_config(self, cookie_policy, credential, client): default_polling_interval_start_time = time.time() - product1 = await client.lros.post_double_headers_final_azure_header_get_default() + poller = await client.lros.begin_post_double_headers_final_azure_header_get_default() + product1 = await poller.result() default_polling_interval_duration = time.time() - default_polling_interval_start_time assert abs(default_polling_interval_duration - 0) < 0.1 @@ -495,19 +499,20 @@ async def test_polling_interval_config(self, cookie_policy, credential, client): ] client_one_second = AutoRestLongRunningOperationTestService(credential, base_url="http://localhost:3000", policies=policies, polling_interval=1) one_second_polling_interval_start_time = time.time() - product2 = await client_one_second.lros.post_double_headers_final_azure_header_get_default() + poller = await client_one_second.lros.begin_post_double_headers_final_azure_header_get_default() + product2 = await poller.result() one_second_polling_interval_duration = time.time() - one_second_polling_interval_start_time assert abs(one_second_polling_interval_duration - 1) < 0.1 assert product1 == product2 @pytest.mark.asyncio async def test_passing_kwargs(self, client, product): - process = await self.lro_result(client.lros.put200_succeeded, product, content_type="application/json") + process = await self.lro_result(client.lros.begin_put200_succeeded, product, content_type="application/json") assert "Succeeded" == process.provisioning_state @pytest.mark.asyncio async def test_lro_list(self, client, product): - products = await self.lro_result(client.lros.post202_list) + products = await self.lro_result(client.lros.begin_post202_list) assert len(products) == 1 product = products[0] assert product.id == "100" From fc7e1aa7553a32941d1e8f7d32298ccc33452caf Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Thu, 21 May 2020 15:49:18 -0700 Subject: [PATCH 09/26] Feedback --- autorest/codegen/templates/lro_operation.py.jinja2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autorest/codegen/templates/lro_operation.py.jinja2 b/autorest/codegen/templates/lro_operation.py.jinja2 index f20e142f1e0..4b69dbee961 100644 --- a/autorest/codegen/templates/lro_operation.py.jinja2 +++ b/autorest/codegen/templates/lro_operation.py.jinja2 @@ -44,7 +44,7 @@ response_headers = { :type {{ parameter.serialized_name }}: {{ parameter.schema.docstring_type }} {% endfor %} :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.{{ "Async" if async_mode else "" }}PollingMethod @@ -101,4 +101,4 @@ response_headers = { ) else: return {{ poller }}(self._client, raw_result, get_long_running_output, polling_method) -{{ operation_name }}.metadata = {'url': '{{ operation.url }}'} # type: ignore +{{ operation_name }}.metadata = {'url': '{{ operation.url }}'} # type: ignore \ No newline at end of file From 5f6315c09836ea17b4d1299c2299d36103ecf942 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Thu, 21 May 2020 15:50:39 -0700 Subject: [PATCH 10/26] Feedback regeneration --- .../_lr_os_custom_header_operations_async.py | 12 +- .../_lro_retrys_operations_async.py | 21 +-- .../_lros_operations_async.py | 123 ++++++------------ .../_lrosads_operations_async.py | 78 ++++------- .../_lr_os_custom_header_operations.py | 12 +- .../lro/operations/_lro_retrys_operations.py | 21 +-- .../Lro/lro/operations/_lros_operations.py | 123 ++++++------------ .../Lro/lro/operations/_lrosads_operations.py | 78 ++++------- 8 files changed, 156 insertions(+), 312 deletions(-) diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py index de41ea0100d..f733757f00e 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py @@ -106,7 +106,7 @@ async def begin_put_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -158,7 +158,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_succeeded.metadata = {'url': '/lro/customheader/putasync/retry/succeeded'} # type: ignore - async def _put201_creating_succeeded200_initial( self, product: Optional["models.Product"] = None, @@ -223,7 +222,7 @@ async def begin_put201_creating_succeeded200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -270,7 +269,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/customheader/put/201/creating/succeeded/200'} # type: ignore - async def _post202_retry200_initial( self, product: Optional["models.Product"] = None, @@ -329,7 +327,7 @@ async def begin_post202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -373,7 +371,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/customheader/post/202/retry/200'} # type: ignore - async def _post_async_retry_succeeded_initial( self, product: Optional["models.Product"] = None, @@ -434,7 +431,7 @@ async def begin_post_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -477,4 +474,3 @@ def get_long_running_output(pipeline_response): else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_succeeded.metadata = {'url': '/lro/customheader/postasync/retry/succeeded'} # type: ignore - diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py index 5f1781f758a..880f701ff66 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py @@ -106,7 +106,7 @@ async def begin_put201_creating_succeeded200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -153,7 +153,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/retryerror/put/201/creating/succeeded/200'} # type: ignore - async def _put_async_relative_retry_succeeded_initial( self, product: Optional["models.Product"] = None, @@ -216,7 +215,7 @@ async def begin_put_async_relative_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -268,7 +267,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/putasync/retry/succeeded'} # type: ignore - async def _delete_provisioning202_accepted200_succeeded_initial( self, **kwargs @@ -322,7 +320,7 @@ async def begin_delete_provisioning202_accepted200_succeeded( returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -372,7 +370,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/retryerror/delete/provisioning/202/accepted/200/succeeded'} # type: ignore - async def _delete202_retry200_initial( self, **kwargs @@ -417,7 +414,7 @@ async def begin_delete202_retry200( return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -460,7 +457,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry200.metadata = {'url': '/lro/retryerror/delete/202/retry/200'} # type: ignore - async def _delete_async_relative_retry_succeeded_initial( self, **kwargs @@ -506,7 +502,7 @@ async def begin_delete_async_relative_retry_succeeded( endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -549,7 +545,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/deleteasync/retry/succeeded'} # type: ignore - async def _post202_retry200_initial( self, product: Optional["models.Product"] = None, @@ -607,7 +602,7 @@ async def begin_post202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -651,7 +646,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/retryerror/post/202/retry/200'} # type: ignore - async def _post_async_relative_retry_succeeded_initial( self, product: Optional["models.Product"] = None, @@ -711,7 +705,7 @@ async def begin_post_async_relative_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -754,4 +748,3 @@ def get_long_running_output(pipeline_response): else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/postasync/retry/succeeded'} # type: ignore - diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py index 4b08b910623..37ca98390ab 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py @@ -102,7 +102,7 @@ async def begin_put200_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -149,7 +149,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_succeeded.metadata = {'url': '/lro/put/200/succeeded'} # type: ignore - async def _put201_succeeded_initial( self, product: Optional["models.Product"] = None, @@ -207,7 +206,7 @@ async def begin_put201_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -254,7 +253,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_succeeded.metadata = {'url': '/lro/put/201/succeeded'} # type: ignore - async def _post202_list_initial( self, **kwargs @@ -306,7 +304,7 @@ async def begin_post202_list( with body [{ 'id': '100', 'name': 'foo' }]. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -352,7 +350,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_list.metadata = {'url': '/lro/list'} # type: ignore - async def _put200_succeeded_no_state_initial( self, product: Optional["models.Product"] = None, @@ -410,7 +407,7 @@ async def begin_put200_succeeded_no_state( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -457,7 +454,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_succeeded_no_state.metadata = {'url': '/lro/put/200/succeeded/nostate'} # type: ignore - async def _put202_retry200_initial( self, product: Optional["models.Product"] = None, @@ -516,7 +512,7 @@ async def begin_put202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -563,7 +559,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put202_retry200.metadata = {'url': '/lro/put/202/retry/200'} # type: ignore - async def _put201_creating_succeeded200_initial( self, product: Optional["models.Product"] = None, @@ -627,7 +622,7 @@ async def begin_put201_creating_succeeded200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -674,7 +669,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/put/201/creating/succeeded/200'} # type: ignore - async def _put200_updating_succeeded204_initial( self, product: Optional["models.Product"] = None, @@ -733,7 +727,7 @@ async def begin_put200_updating_succeeded204( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -780,7 +774,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_updating_succeeded204.metadata = {'url': '/lro/put/200/updating/succeeded/200'} # type: ignore - async def _put201_creating_failed200_initial( self, product: Optional["models.Product"] = None, @@ -844,7 +837,7 @@ async def begin_put201_creating_failed200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -891,7 +884,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_failed200.metadata = {'url': '/lro/put/201/created/failed/200'} # type: ignore - async def _put200_acceptedcanceled200_initial( self, product: Optional["models.Product"] = None, @@ -950,7 +942,7 @@ async def begin_put200_acceptedcanceled200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -997,7 +989,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_acceptedcanceled200.metadata = {'url': '/lro/put/200/accepted/canceled/200'} # type: ignore - async def _put_no_header_in_retry_initial( self, product: Optional["models.Product"] = None, @@ -1057,7 +1048,7 @@ async def begin_put_no_header_in_retry( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1107,7 +1098,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_no_header_in_retry.metadata = {'url': '/lro/put/noheader/202/200'} # type: ignore - async def _put_async_retry_succeeded_initial( self, product: Optional["models.Product"] = None, @@ -1170,7 +1160,7 @@ async def begin_put_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1222,7 +1212,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_succeeded.metadata = {'url': '/lro/putasync/retry/succeeded'} # type: ignore - async def _put_async_no_retry_succeeded_initial( self, product: Optional["models.Product"] = None, @@ -1284,7 +1273,7 @@ async def begin_put_async_no_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1335,7 +1324,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_retry_succeeded.metadata = {'url': '/lro/putasync/noretry/succeeded'} # type: ignore - async def _put_async_retry_failed_initial( self, product: Optional["models.Product"] = None, @@ -1398,7 +1386,7 @@ async def begin_put_async_retry_failed( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1450,7 +1438,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_failed.metadata = {'url': '/lro/putasync/retry/failed'} # type: ignore - async def _put_async_no_retrycanceled_initial( self, product: Optional["models.Product"] = None, @@ -1512,7 +1499,7 @@ async def begin_put_async_no_retrycanceled( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1563,7 +1550,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_retrycanceled.metadata = {'url': '/lro/putasync/noretry/canceled'} # type: ignore - async def _put_async_no_header_in_retry_initial( self, product: Optional["models.Product"] = None, @@ -1624,7 +1610,7 @@ async def begin_put_async_no_header_in_retry( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1674,7 +1660,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_header_in_retry.metadata = {'url': '/lro/putasync/noheader/201/200'} # type: ignore - async def _put_non_resource_initial( self, sku: Optional["models.Sku"] = None, @@ -1731,7 +1716,7 @@ async def begin_put_non_resource( :param sku: sku to put. :type sku: ~lro.models.Sku :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1778,7 +1763,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_resource.metadata = {'url': '/lro/putnonresource/202/200'} # type: ignore - async def _put_async_non_resource_initial( self, sku: Optional["models.Sku"] = None, @@ -1835,7 +1819,7 @@ async def begin_put_async_non_resource( :param sku: Sku to put. :type sku: ~lro.models.Sku :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1882,7 +1866,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_non_resource.metadata = {'url': '/lro/putnonresourceasync/202/200'} # type: ignore - async def _put_sub_resource_initial( self, provisioning_state: Optional[str] = None, @@ -1941,7 +1924,7 @@ async def begin_put_sub_resource( :param provisioning_state: :type provisioning_state: str :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1988,7 +1971,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_sub_resource.metadata = {'url': '/lro/putsubresource/202/200'} # type: ignore - async def _put_async_sub_resource_initial( self, provisioning_state: Optional[str] = None, @@ -2047,7 +2029,7 @@ async def begin_put_async_sub_resource( :param provisioning_state: :type provisioning_state: str :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2094,7 +2076,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_sub_resource.metadata = {'url': '/lro/putsubresourceasync/202/200'} # type: ignore - async def _delete_provisioning202_accepted200_succeeded_initial( self, **kwargs @@ -2148,7 +2129,7 @@ async def begin_delete_provisioning202_accepted200_succeeded( ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2198,7 +2179,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/delete/provisioning/202/accepted/200/succeeded'} # type: ignore - async def _delete_provisioning202_deleting_failed200_initial( self, **kwargs @@ -2252,7 +2232,7 @@ async def begin_delete_provisioning202_deleting_failed200( ‘200’ with ProvisioningState=’Failed’. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2302,7 +2282,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_deleting_failed200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/failed'} # type: ignore - async def _delete_provisioning202_deletingcanceled200_initial( self, **kwargs @@ -2356,7 +2335,7 @@ async def begin_delete_provisioning202_deletingcanceled200( ‘200’ with ProvisioningState=’Canceled’. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2406,7 +2385,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_deletingcanceled200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/canceled'} # type: ignore - async def _delete204_succeeded_initial( self, **kwargs @@ -2446,7 +2424,7 @@ async def begin_delete204_succeeded( """Long running delete succeeds and returns right away. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2489,7 +2467,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete204_succeeded.metadata = {'url': '/lro/delete/204/succeeded'} # type: ignore - async def _delete202_retry200_initial( self, **kwargs @@ -2541,7 +2518,7 @@ async def begin_delete202_retry200( value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2587,7 +2564,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry200.metadata = {'url': '/lro/delete/202/retry/200'} # type: ignore - async def _delete202_no_retry204_initial( self, **kwargs @@ -2639,7 +2615,7 @@ async def begin_delete202_no_retry204( value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2685,7 +2661,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_no_retry204.metadata = {'url': '/lro/delete/202/noretry/204'} # type: ignore - async def _delete_no_header_in_retry_initial( self, **kwargs @@ -2730,7 +2705,7 @@ async def begin_delete_no_header_in_retry( Subsequent calls to operation status do not contain location header. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2773,7 +2748,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_no_header_in_retry.metadata = {'url': '/lro/delete/noheader'} # type: ignore - async def _delete_async_no_header_in_retry_initial( self, **kwargs @@ -2818,7 +2792,7 @@ async def begin_delete_async_no_header_in_retry( request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2861,7 +2835,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_no_header_in_retry.metadata = {'url': '/lro/deleteasync/noheader/202/204'} # type: ignore - async def _delete_async_retry_succeeded_initial( self, **kwargs @@ -2907,7 +2880,7 @@ async def begin_delete_async_retry_succeeded( indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2950,7 +2923,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retry_succeeded.metadata = {'url': '/lro/deleteasync/retry/succeeded'} # type: ignore - async def _delete_async_no_retry_succeeded_initial( self, **kwargs @@ -2996,7 +2968,7 @@ async def begin_delete_async_no_retry_succeeded( indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -3039,7 +3011,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_no_retry_succeeded.metadata = {'url': '/lro/deleteasync/noretry/succeeded'} # type: ignore - async def _delete_async_retry_failed_initial( self, **kwargs @@ -3085,7 +3056,7 @@ async def begin_delete_async_retry_failed( indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -3128,7 +3099,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retry_failed.metadata = {'url': '/lro/deleteasync/retry/failed'} # type: ignore - async def _delete_async_retrycanceled_initial( self, **kwargs @@ -3174,7 +3144,7 @@ async def begin_delete_async_retrycanceled( indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -3217,7 +3187,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retrycanceled.metadata = {'url': '/lro/deleteasync/retry/canceled'} # type: ignore - async def _post200_with_payload_initial( self, **kwargs @@ -3267,7 +3236,7 @@ async def begin_post200_with_payload( header. Poll returns a 200 with a response body after success. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -3313,7 +3282,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post200_with_payload.metadata = {'url': '/lro/post/payload/200'} # type: ignore - async def _post202_retry200_initial( self, product: Optional["models.Product"] = None, @@ -3371,7 +3339,7 @@ async def begin_post202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -3415,7 +3383,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/post/202/retry/200'} # type: ignore - async def _post202_no_retry204_initial( self, product: Optional["models.Product"] = None, @@ -3476,7 +3443,7 @@ async def begin_post202_no_retry204( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -3527,7 +3494,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_no_retry204.metadata = {'url': '/lro/post/202/noretry/204'} # type: ignore - async def _post_double_headers_final_location_get_initial( self, **kwargs @@ -3573,7 +3539,7 @@ async def begin_post_double_headers_final_location_get( object. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -3619,7 +3585,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_location_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalLocationGet'} # type: ignore - async def _post_double_headers_final_azure_header_get_initial( self, **kwargs @@ -3665,7 +3630,7 @@ async def begin_post_double_headers_final_azure_header_get( final object. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -3711,7 +3676,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_azure_header_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGet'} # type: ignore - async def _post_double_headers_final_azure_header_get_default_initial( self, **kwargs @@ -3757,7 +3721,7 @@ async def begin_post_double_headers_final_azure_header_get_default( final object if you support initial Autorest behavior. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -3803,7 +3767,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_azure_header_get_default.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGetDefault'} # type: ignore - async def _post_async_retry_succeeded_initial( self, product: Optional["models.Product"] = None, @@ -3870,7 +3833,7 @@ async def begin_post_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -3917,7 +3880,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_succeeded.metadata = {'url': '/lro/postasync/retry/succeeded'} # type: ignore - async def _post_async_no_retry_succeeded_initial( self, product: Optional["models.Product"] = None, @@ -3984,7 +3946,7 @@ async def begin_post_async_no_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -4031,7 +3993,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_no_retry_succeeded.metadata = {'url': '/lro/postasync/noretry/succeeded'} # type: ignore - async def _post_async_retry_failed_initial( self, product: Optional["models.Product"] = None, @@ -4091,7 +4052,7 @@ async def begin_post_async_retry_failed( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -4135,7 +4096,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_failed.metadata = {'url': '/lro/postasync/retry/failed'} # type: ignore - async def _post_async_retrycanceled_initial( self, product: Optional["models.Product"] = None, @@ -4195,7 +4155,7 @@ async def begin_post_async_retrycanceled( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -4238,4 +4198,3 @@ def get_long_running_output(pipeline_response): else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retrycanceled.metadata = {'url': '/lro/postasync/retry/canceled'} # type: ignore - diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py index 2e0613bd0a7..3533a151ed1 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py @@ -104,7 +104,7 @@ async def begin_put_non_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -151,7 +151,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry400.metadata = {'url': '/lro/nonretryerror/put/400'} # type: ignore - async def _put_non_retry201_creating400_initial( self, product: Optional["models.Product"] = None, @@ -214,7 +213,7 @@ async def begin_put_non_retry201_creating400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -261,7 +260,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry201_creating400.metadata = {'url': '/lro/nonretryerror/put/201/creating/400'} # type: ignore - async def _put_non_retry201_creating400_invalid_json_initial( self, product: Optional["models.Product"] = None, @@ -324,7 +322,7 @@ async def begin_put_non_retry201_creating400_invalid_json( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -371,7 +369,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry201_creating400_invalid_json.metadata = {'url': '/lro/nonretryerror/put/201/creating/400/invalidjson'} # type: ignore - async def _put_async_relative_retry400_initial( self, product: Optional["models.Product"] = None, @@ -433,7 +430,7 @@ async def begin_put_async_relative_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -485,7 +482,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/putasync/retry/400'} # type: ignore - async def _delete_non_retry400_initial( self, **kwargs @@ -529,7 +525,7 @@ async def begin_delete_non_retry400( """Long running delete request, service returns a 400 with an error body. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -572,7 +568,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/400'} # type: ignore - async def _delete202_non_retry400_initial( self, **kwargs @@ -616,7 +611,7 @@ async def begin_delete202_non_retry400( """Long running delete request, service returns a 202 with a location header. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -659,7 +654,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/202/retry/400'} # type: ignore - async def _delete_async_relative_retry400_initial( self, **kwargs @@ -705,7 +699,7 @@ async def begin_delete_async_relative_retry400( indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -748,7 +742,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/deleteasync/retry/400'} # type: ignore - async def _post_non_retry400_initial( self, product: Optional["models.Product"] = None, @@ -805,7 +798,7 @@ async def begin_post_non_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -849,7 +842,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_non_retry400.metadata = {'url': '/lro/nonretryerror/post/400'} # type: ignore - async def _post202_non_retry400_initial( self, product: Optional["models.Product"] = None, @@ -906,7 +898,7 @@ async def begin_post202_non_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -950,7 +942,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_non_retry400.metadata = {'url': '/lro/nonretryerror/post/202/retry/400'} # type: ignore - async def _post_async_relative_retry400_initial( self, product: Optional["models.Product"] = None, @@ -1009,7 +1000,7 @@ async def begin_post_async_relative_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1053,7 +1044,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/postasync/retry/400'} # type: ignore - async def _put_error201_no_provisioning_state_payload_initial( self, product: Optional["models.Product"] = None, @@ -1115,7 +1105,7 @@ async def begin_put_error201_no_provisioning_state_payload( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1162,7 +1152,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_error201_no_provisioning_state_payload.metadata = {'url': '/lro/error/put/201/noprovisioningstatepayload'} # type: ignore - async def _put_async_relative_retry_no_status_initial( self, product: Optional["models.Product"] = None, @@ -1225,7 +1214,7 @@ async def begin_put_async_relative_retry_no_status( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1277,7 +1266,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_no_status.metadata = {'url': '/lro/error/putasync/retry/nostatus'} # type: ignore - async def _put_async_relative_retry_no_status_payload_initial( self, product: Optional["models.Product"] = None, @@ -1340,7 +1328,7 @@ async def begin_put_async_relative_retry_no_status_payload( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1392,7 +1380,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_no_status_payload.metadata = {'url': '/lro/error/putasync/retry/nostatuspayload'} # type: ignore - async def _delete204_succeeded_initial( self, **kwargs @@ -1432,7 +1419,7 @@ async def begin_delete204_succeeded( """Long running delete request, service returns a 204 to the initial request, indicating success. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1475,7 +1462,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete204_succeeded.metadata = {'url': '/lro/error/delete/204/nolocation'} # type: ignore - async def _delete_async_relative_retry_no_status_initial( self, **kwargs @@ -1521,7 +1507,7 @@ async def begin_delete_async_relative_retry_no_status( indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1564,7 +1550,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_no_status.metadata = {'url': '/lro/error/deleteasync/retry/nostatus'} # type: ignore - async def _post202_no_location_initial( self, product: Optional["models.Product"] = None, @@ -1622,7 +1607,7 @@ async def begin_post202_no_location( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1666,7 +1651,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_no_location.metadata = {'url': '/lro/error/post/202/nolocation'} # type: ignore - async def _post_async_relative_retry_no_payload_initial( self, product: Optional["models.Product"] = None, @@ -1726,7 +1710,7 @@ async def begin_post_async_relative_retry_no_payload( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1770,7 +1754,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_no_payload.metadata = {'url': '/lro/error/postasync/retry/nopayload'} # type: ignore - async def _put200_invalid_json_initial( self, product: Optional["models.Product"] = None, @@ -1830,7 +1813,7 @@ async def begin_put200_invalid_json( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1877,7 +1860,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_invalid_json.metadata = {'url': '/lro/error/put/200/invalidjson'} # type: ignore - async def _put_async_relative_retry_invalid_header_initial( self, product: Optional["models.Product"] = None, @@ -1940,7 +1922,7 @@ async def begin_put_async_relative_retry_invalid_header( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1992,7 +1974,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/putasync/retry/invalidheader'} # type: ignore - async def _put_async_relative_retry_invalid_json_polling_initial( self, product: Optional["models.Product"] = None, @@ -2055,7 +2036,7 @@ async def begin_put_async_relative_retry_invalid_json_polling( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2107,7 +2088,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/putasync/retry/invalidjsonpolling'} # type: ignore - async def _delete202_retry_invalid_header_initial( self, **kwargs @@ -2152,7 +2132,7 @@ async def begin_delete202_retry_invalid_header( with an invalid 'Location' and 'Retry-After' headers. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2195,7 +2175,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry_invalid_header.metadata = {'url': '/lro/error/delete/202/retry/invalidheader'} # type: ignore - async def _delete_async_relative_retry_invalid_header_initial( self, **kwargs @@ -2241,7 +2220,7 @@ async def begin_delete_async_relative_retry_invalid_header( indicated in the Azure-AsyncOperation header is invalid. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2284,7 +2263,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/deleteasync/retry/invalidheader'} # type: ignore - async def _delete_async_relative_retry_invalid_json_polling_initial( self, **kwargs @@ -2330,7 +2308,7 @@ async def begin_delete_async_relative_retry_invalid_json_polling( indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2373,7 +2351,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/deleteasync/retry/invalidjsonpolling'} # type: ignore - async def _post202_retry_invalid_header_initial( self, product: Optional["models.Product"] = None, @@ -2431,7 +2408,7 @@ async def begin_post202_retry_invalid_header( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2475,7 +2452,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry_invalid_header.metadata = {'url': '/lro/error/post/202/retry/invalidheader'} # type: ignore - async def _post_async_relative_retry_invalid_header_initial( self, product: Optional["models.Product"] = None, @@ -2535,7 +2511,7 @@ async def begin_post_async_relative_retry_invalid_header( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2579,7 +2555,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/postasync/retry/invalidheader'} # type: ignore - async def _post_async_relative_retry_invalid_json_polling_initial( self, product: Optional["models.Product"] = None, @@ -2639,7 +2614,7 @@ async def begin_post_async_relative_retry_invalid_json_polling( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -2682,4 +2657,3 @@ def get_long_running_output(pipeline_response): else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/postasync/retry/invalidjsonpolling'} # type: ignore - diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py index ffb9feb39e1..4fbd3ed5f9b 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py @@ -112,7 +112,7 @@ def begin_put_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -164,7 +164,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_succeeded.metadata = {'url': '/lro/customheader/putasync/retry/succeeded'} # type: ignore - def _put201_creating_succeeded200_initial( self, product=None, # type: Optional["models.Product"] @@ -231,7 +230,7 @@ def begin_put201_creating_succeeded200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -278,7 +277,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/customheader/put/201/creating/succeeded/200'} # type: ignore - def _post202_retry200_initial( self, product=None, # type: Optional["models.Product"] @@ -339,7 +337,7 @@ def begin_post202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -383,7 +381,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/customheader/post/202/retry/200'} # type: ignore - def _post_async_retry_succeeded_initial( self, product=None, # type: Optional["models.Product"] @@ -446,7 +443,7 @@ def begin_post_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -489,4 +486,3 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_succeeded.metadata = {'url': '/lro/customheader/postasync/retry/succeeded'} # type: ignore - diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py index e144a049e31..005103e8602 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py @@ -112,7 +112,7 @@ def begin_put201_creating_succeeded200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -159,7 +159,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/retryerror/put/201/creating/succeeded/200'} # type: ignore - def _put_async_relative_retry_succeeded_initial( self, product=None, # type: Optional["models.Product"] @@ -224,7 +223,7 @@ def begin_put_async_relative_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -276,7 +275,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/putasync/retry/succeeded'} # type: ignore - def _delete_provisioning202_accepted200_succeeded_initial( self, **kwargs # type: Any @@ -332,7 +330,7 @@ def begin_delete_provisioning202_accepted200_succeeded( returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -382,7 +380,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/retryerror/delete/provisioning/202/accepted/200/succeeded'} # type: ignore - def _delete202_retry200_initial( self, **kwargs # type: Any @@ -429,7 +426,7 @@ def begin_delete202_retry200( return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -472,7 +469,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry200.metadata = {'url': '/lro/retryerror/delete/202/retry/200'} # type: ignore - def _delete_async_relative_retry_succeeded_initial( self, **kwargs # type: Any @@ -520,7 +516,7 @@ def begin_delete_async_relative_retry_succeeded( endpoint indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -563,7 +559,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/deleteasync/retry/succeeded'} # type: ignore - def _post202_retry200_initial( self, product=None, # type: Optional["models.Product"] @@ -623,7 +618,7 @@ def begin_post202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -667,7 +662,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/retryerror/post/202/retry/200'} # type: ignore - def _post_async_relative_retry_succeeded_initial( self, product=None, # type: Optional["models.Product"] @@ -729,7 +723,7 @@ def begin_post_async_relative_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -772,4 +766,3 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_succeeded.metadata = {'url': '/lro/retryerror/postasync/retry/succeeded'} # type: ignore - diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py index 623d81f8851..431fbba40b6 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py @@ -108,7 +108,7 @@ def begin_put200_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -155,7 +155,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_succeeded.metadata = {'url': '/lro/put/200/succeeded'} # type: ignore - def _put201_succeeded_initial( self, product=None, # type: Optional["models.Product"] @@ -215,7 +214,7 @@ def begin_put201_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -262,7 +261,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_succeeded.metadata = {'url': '/lro/put/201/succeeded'} # type: ignore - def _post202_list_initial( self, **kwargs # type: Any @@ -316,7 +314,7 @@ def begin_post202_list( with body [{ 'id': '100', 'name': 'foo' }]. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -362,7 +360,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_list.metadata = {'url': '/lro/list'} # type: ignore - def _put200_succeeded_no_state_initial( self, product=None, # type: Optional["models.Product"] @@ -422,7 +419,7 @@ def begin_put200_succeeded_no_state( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -469,7 +466,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_succeeded_no_state.metadata = {'url': '/lro/put/200/succeeded/nostate'} # type: ignore - def _put202_retry200_initial( self, product=None, # type: Optional["models.Product"] @@ -530,7 +526,7 @@ def begin_put202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -577,7 +573,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put202_retry200.metadata = {'url': '/lro/put/202/retry/200'} # type: ignore - def _put201_creating_succeeded200_initial( self, product=None, # type: Optional["models.Product"] @@ -643,7 +638,7 @@ def begin_put201_creating_succeeded200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -690,7 +685,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_succeeded200.metadata = {'url': '/lro/put/201/creating/succeeded/200'} # type: ignore - def _put200_updating_succeeded204_initial( self, product=None, # type: Optional["models.Product"] @@ -751,7 +745,7 @@ def begin_put200_updating_succeeded204( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -798,7 +792,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_updating_succeeded204.metadata = {'url': '/lro/put/200/updating/succeeded/200'} # type: ignore - def _put201_creating_failed200_initial( self, product=None, # type: Optional["models.Product"] @@ -864,7 +857,7 @@ def begin_put201_creating_failed200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -911,7 +904,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put201_creating_failed200.metadata = {'url': '/lro/put/201/created/failed/200'} # type: ignore - def _put200_acceptedcanceled200_initial( self, product=None, # type: Optional["models.Product"] @@ -972,7 +964,7 @@ def begin_put200_acceptedcanceled200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1019,7 +1011,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_acceptedcanceled200.metadata = {'url': '/lro/put/200/accepted/canceled/200'} # type: ignore - def _put_no_header_in_retry_initial( self, product=None, # type: Optional["models.Product"] @@ -1081,7 +1072,7 @@ def begin_put_no_header_in_retry( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1131,7 +1122,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_no_header_in_retry.metadata = {'url': '/lro/put/noheader/202/200'} # type: ignore - def _put_async_retry_succeeded_initial( self, product=None, # type: Optional["models.Product"] @@ -1196,7 +1186,7 @@ def begin_put_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1248,7 +1238,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_succeeded.metadata = {'url': '/lro/putasync/retry/succeeded'} # type: ignore - def _put_async_no_retry_succeeded_initial( self, product=None, # type: Optional["models.Product"] @@ -1312,7 +1301,7 @@ def begin_put_async_no_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1363,7 +1352,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_retry_succeeded.metadata = {'url': '/lro/putasync/noretry/succeeded'} # type: ignore - def _put_async_retry_failed_initial( self, product=None, # type: Optional["models.Product"] @@ -1428,7 +1416,7 @@ def begin_put_async_retry_failed( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1480,7 +1468,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_retry_failed.metadata = {'url': '/lro/putasync/retry/failed'} # type: ignore - def _put_async_no_retrycanceled_initial( self, product=None, # type: Optional["models.Product"] @@ -1544,7 +1531,7 @@ def begin_put_async_no_retrycanceled( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1595,7 +1582,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_retrycanceled.metadata = {'url': '/lro/putasync/noretry/canceled'} # type: ignore - def _put_async_no_header_in_retry_initial( self, product=None, # type: Optional["models.Product"] @@ -1658,7 +1644,7 @@ def begin_put_async_no_header_in_retry( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1708,7 +1694,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_no_header_in_retry.metadata = {'url': '/lro/putasync/noheader/201/200'} # type: ignore - def _put_non_resource_initial( self, sku=None, # type: Optional["models.Sku"] @@ -1767,7 +1752,7 @@ def begin_put_non_resource( :param sku: sku to put. :type sku: ~lro.models.Sku :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1814,7 +1799,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_resource.metadata = {'url': '/lro/putnonresource/202/200'} # type: ignore - def _put_async_non_resource_initial( self, sku=None, # type: Optional["models.Sku"] @@ -1873,7 +1857,7 @@ def begin_put_async_non_resource( :param sku: Sku to put. :type sku: ~lro.models.Sku :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1920,7 +1904,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_non_resource.metadata = {'url': '/lro/putnonresourceasync/202/200'} # type: ignore - def _put_sub_resource_initial( self, provisioning_state=None, # type: Optional[str] @@ -1981,7 +1964,7 @@ def begin_put_sub_resource( :param provisioning_state: :type provisioning_state: str :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2028,7 +2011,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_sub_resource.metadata = {'url': '/lro/putsubresource/202/200'} # type: ignore - def _put_async_sub_resource_initial( self, provisioning_state=None, # type: Optional[str] @@ -2089,7 +2071,7 @@ def begin_put_async_sub_resource( :param provisioning_state: :type provisioning_state: str :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2136,7 +2118,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_sub_resource.metadata = {'url': '/lro/putsubresourceasync/202/200'} # type: ignore - def _delete_provisioning202_accepted200_succeeded_initial( self, **kwargs # type: Any @@ -2192,7 +2173,7 @@ def begin_delete_provisioning202_accepted200_succeeded( ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2242,7 +2223,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_accepted200_succeeded.metadata = {'url': '/lro/delete/provisioning/202/accepted/200/succeeded'} # type: ignore - def _delete_provisioning202_deleting_failed200_initial( self, **kwargs # type: Any @@ -2298,7 +2278,7 @@ def begin_delete_provisioning202_deleting_failed200( ‘200’ with ProvisioningState=’Failed’. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2348,7 +2328,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_deleting_failed200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/failed'} # type: ignore - def _delete_provisioning202_deletingcanceled200_initial( self, **kwargs # type: Any @@ -2404,7 +2383,7 @@ def begin_delete_provisioning202_deletingcanceled200( ‘200’ with ProvisioningState=’Canceled’. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2454,7 +2433,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_provisioning202_deletingcanceled200.metadata = {'url': '/lro/delete/provisioning/202/deleting/200/canceled'} # type: ignore - def _delete204_succeeded_initial( self, **kwargs # type: Any @@ -2496,7 +2474,7 @@ def begin_delete204_succeeded( """Long running delete succeeds and returns right away. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2539,7 +2517,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete204_succeeded.metadata = {'url': '/lro/delete/204/succeeded'} # type: ignore - def _delete202_retry200_initial( self, **kwargs # type: Any @@ -2593,7 +2570,7 @@ def begin_delete202_retry200( value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2639,7 +2616,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry200.metadata = {'url': '/lro/delete/202/retry/200'} # type: ignore - def _delete202_no_retry204_initial( self, **kwargs # type: Any @@ -2693,7 +2669,7 @@ def begin_delete202_no_retry204( value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2739,7 +2715,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_no_retry204.metadata = {'url': '/lro/delete/202/noretry/204'} # type: ignore - def _delete_no_header_in_retry_initial( self, **kwargs # type: Any @@ -2786,7 +2761,7 @@ def begin_delete_no_header_in_retry( Subsequent calls to operation status do not contain location header. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2829,7 +2804,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_no_header_in_retry.metadata = {'url': '/lro/delete/noheader'} # type: ignore - def _delete_async_no_header_in_retry_initial( self, **kwargs # type: Any @@ -2876,7 +2850,7 @@ def begin_delete_async_no_header_in_retry( request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2919,7 +2893,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_no_header_in_retry.metadata = {'url': '/lro/deleteasync/noheader/202/204'} # type: ignore - def _delete_async_retry_succeeded_initial( self, **kwargs # type: Any @@ -2967,7 +2940,7 @@ def begin_delete_async_retry_succeeded( indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3010,7 +2983,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retry_succeeded.metadata = {'url': '/lro/deleteasync/retry/succeeded'} # type: ignore - def _delete_async_no_retry_succeeded_initial( self, **kwargs # type: Any @@ -3058,7 +3030,7 @@ def begin_delete_async_no_retry_succeeded( indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3101,7 +3073,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_no_retry_succeeded.metadata = {'url': '/lro/deleteasync/noretry/succeeded'} # type: ignore - def _delete_async_retry_failed_initial( self, **kwargs # type: Any @@ -3149,7 +3120,7 @@ def begin_delete_async_retry_failed( indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3192,7 +3163,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retry_failed.metadata = {'url': '/lro/deleteasync/retry/failed'} # type: ignore - def _delete_async_retrycanceled_initial( self, **kwargs # type: Any @@ -3240,7 +3210,7 @@ def begin_delete_async_retrycanceled( indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3283,7 +3253,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_retrycanceled.metadata = {'url': '/lro/deleteasync/retry/canceled'} # type: ignore - def _post200_with_payload_initial( self, **kwargs # type: Any @@ -3335,7 +3304,7 @@ def begin_post200_with_payload( header. Poll returns a 200 with a response body after success. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3381,7 +3350,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post200_with_payload.metadata = {'url': '/lro/post/payload/200'} # type: ignore - def _post202_retry200_initial( self, product=None, # type: Optional["models.Product"] @@ -3441,7 +3409,7 @@ def begin_post202_retry200( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3485,7 +3453,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry200.metadata = {'url': '/lro/post/202/retry/200'} # type: ignore - def _post202_no_retry204_initial( self, product=None, # type: Optional["models.Product"] @@ -3548,7 +3515,7 @@ def begin_post202_no_retry204( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3599,7 +3566,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_no_retry204.metadata = {'url': '/lro/post/202/noretry/204'} # type: ignore - def _post_double_headers_final_location_get_initial( self, **kwargs # type: Any @@ -3647,7 +3613,7 @@ def begin_post_double_headers_final_location_get( object. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3693,7 +3659,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_location_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalLocationGet'} # type: ignore - def _post_double_headers_final_azure_header_get_initial( self, **kwargs # type: Any @@ -3741,7 +3706,7 @@ def begin_post_double_headers_final_azure_header_get( final object. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3787,7 +3752,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_azure_header_get.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGet'} # type: ignore - def _post_double_headers_final_azure_header_get_default_initial( self, **kwargs # type: Any @@ -3835,7 +3799,7 @@ def begin_post_double_headers_final_azure_header_get_default( final object if you support initial Autorest behavior. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3881,7 +3845,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_double_headers_final_azure_header_get_default.metadata = {'url': '/lro/LROPostDoubleHeadersFinalAzureHeaderGetDefault'} # type: ignore - def _post_async_retry_succeeded_initial( self, product=None, # type: Optional["models.Product"] @@ -3950,7 +3913,7 @@ def begin_post_async_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -3997,7 +3960,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_succeeded.metadata = {'url': '/lro/postasync/retry/succeeded'} # type: ignore - def _post_async_no_retry_succeeded_initial( self, product=None, # type: Optional["models.Product"] @@ -4066,7 +4028,7 @@ def begin_post_async_no_retry_succeeded( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -4113,7 +4075,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_no_retry_succeeded.metadata = {'url': '/lro/postasync/noretry/succeeded'} # type: ignore - def _post_async_retry_failed_initial( self, product=None, # type: Optional["models.Product"] @@ -4175,7 +4136,7 @@ def begin_post_async_retry_failed( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -4219,7 +4180,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retry_failed.metadata = {'url': '/lro/postasync/retry/failed'} # type: ignore - def _post_async_retrycanceled_initial( self, product=None, # type: Optional["models.Product"] @@ -4281,7 +4241,7 @@ def begin_post_async_retrycanceled( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -4324,4 +4284,3 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_retrycanceled.metadata = {'url': '/lro/postasync/retry/canceled'} # type: ignore - diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py index 477f340c163..6018f3a552d 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py @@ -110,7 +110,7 @@ def begin_put_non_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -157,7 +157,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry400.metadata = {'url': '/lro/nonretryerror/put/400'} # type: ignore - def _put_non_retry201_creating400_initial( self, product=None, # type: Optional["models.Product"] @@ -222,7 +221,7 @@ def begin_put_non_retry201_creating400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -269,7 +268,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry201_creating400.metadata = {'url': '/lro/nonretryerror/put/201/creating/400'} # type: ignore - def _put_non_retry201_creating400_invalid_json_initial( self, product=None, # type: Optional["models.Product"] @@ -334,7 +332,7 @@ def begin_put_non_retry201_creating400_invalid_json( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -381,7 +379,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_non_retry201_creating400_invalid_json.metadata = {'url': '/lro/nonretryerror/put/201/creating/400/invalidjson'} # type: ignore - def _put_async_relative_retry400_initial( self, product=None, # type: Optional["models.Product"] @@ -445,7 +442,7 @@ def begin_put_async_relative_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -497,7 +494,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/putasync/retry/400'} # type: ignore - def _delete_non_retry400_initial( self, **kwargs # type: Any @@ -543,7 +539,7 @@ def begin_delete_non_retry400( """Long running delete request, service returns a 400 with an error body. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -586,7 +582,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/400'} # type: ignore - def _delete202_non_retry400_initial( self, **kwargs # type: Any @@ -632,7 +627,7 @@ def begin_delete202_non_retry400( """Long running delete request, service returns a 202 with a location header. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -675,7 +670,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_non_retry400.metadata = {'url': '/lro/nonretryerror/delete/202/retry/400'} # type: ignore - def _delete_async_relative_retry400_initial( self, **kwargs # type: Any @@ -723,7 +717,7 @@ def begin_delete_async_relative_retry400( indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -766,7 +760,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/deleteasync/retry/400'} # type: ignore - def _post_non_retry400_initial( self, product=None, # type: Optional["models.Product"] @@ -825,7 +818,7 @@ def begin_post_non_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -869,7 +862,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_non_retry400.metadata = {'url': '/lro/nonretryerror/post/400'} # type: ignore - def _post202_non_retry400_initial( self, product=None, # type: Optional["models.Product"] @@ -928,7 +920,7 @@ def begin_post202_non_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -972,7 +964,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_non_retry400.metadata = {'url': '/lro/nonretryerror/post/202/retry/400'} # type: ignore - def _post_async_relative_retry400_initial( self, product=None, # type: Optional["models.Product"] @@ -1033,7 +1024,7 @@ def begin_post_async_relative_retry400( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1077,7 +1068,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry400.metadata = {'url': '/lro/nonretryerror/postasync/retry/400'} # type: ignore - def _put_error201_no_provisioning_state_payload_initial( self, product=None, # type: Optional["models.Product"] @@ -1141,7 +1131,7 @@ def begin_put_error201_no_provisioning_state_payload( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1188,7 +1178,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_error201_no_provisioning_state_payload.metadata = {'url': '/lro/error/put/201/noprovisioningstatepayload'} # type: ignore - def _put_async_relative_retry_no_status_initial( self, product=None, # type: Optional["models.Product"] @@ -1253,7 +1242,7 @@ def begin_put_async_relative_retry_no_status( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1305,7 +1294,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_no_status.metadata = {'url': '/lro/error/putasync/retry/nostatus'} # type: ignore - def _put_async_relative_retry_no_status_payload_initial( self, product=None, # type: Optional["models.Product"] @@ -1370,7 +1358,7 @@ def begin_put_async_relative_retry_no_status_payload( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1422,7 +1410,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_no_status_payload.metadata = {'url': '/lro/error/putasync/retry/nostatuspayload'} # type: ignore - def _delete204_succeeded_initial( self, **kwargs # type: Any @@ -1464,7 +1451,7 @@ def begin_delete204_succeeded( """Long running delete request, service returns a 204 to the initial request, indicating success. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1507,7 +1494,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete204_succeeded.metadata = {'url': '/lro/error/delete/204/nolocation'} # type: ignore - def _delete_async_relative_retry_no_status_initial( self, **kwargs # type: Any @@ -1555,7 +1541,7 @@ def begin_delete_async_relative_retry_no_status( indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1598,7 +1584,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_no_status.metadata = {'url': '/lro/error/deleteasync/retry/nostatus'} # type: ignore - def _post202_no_location_initial( self, product=None, # type: Optional["models.Product"] @@ -1658,7 +1643,7 @@ def begin_post202_no_location( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1702,7 +1687,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_no_location.metadata = {'url': '/lro/error/post/202/nolocation'} # type: ignore - def _post_async_relative_retry_no_payload_initial( self, product=None, # type: Optional["models.Product"] @@ -1764,7 +1748,7 @@ def begin_post_async_relative_retry_no_payload( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1808,7 +1792,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_no_payload.metadata = {'url': '/lro/error/postasync/retry/nopayload'} # type: ignore - def _put200_invalid_json_initial( self, product=None, # type: Optional["models.Product"] @@ -1870,7 +1853,7 @@ def begin_put200_invalid_json( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1917,7 +1900,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put200_invalid_json.metadata = {'url': '/lro/error/put/200/invalidjson'} # type: ignore - def _put_async_relative_retry_invalid_header_initial( self, product=None, # type: Optional["models.Product"] @@ -1982,7 +1964,7 @@ def begin_put_async_relative_retry_invalid_header( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2034,7 +2016,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/putasync/retry/invalidheader'} # type: ignore - def _put_async_relative_retry_invalid_json_polling_initial( self, product=None, # type: Optional["models.Product"] @@ -2099,7 +2080,7 @@ def begin_put_async_relative_retry_invalid_json_polling( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2151,7 +2132,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_put_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/putasync/retry/invalidjsonpolling'} # type: ignore - def _delete202_retry_invalid_header_initial( self, **kwargs # type: Any @@ -2198,7 +2178,7 @@ def begin_delete202_retry_invalid_header( with an invalid 'Location' and 'Retry-After' headers. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2241,7 +2221,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete202_retry_invalid_header.metadata = {'url': '/lro/error/delete/202/retry/invalidheader'} # type: ignore - def _delete_async_relative_retry_invalid_header_initial( self, **kwargs # type: Any @@ -2289,7 +2268,7 @@ def begin_delete_async_relative_retry_invalid_header( indicated in the Azure-AsyncOperation header is invalid. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2332,7 +2311,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/deleteasync/retry/invalidheader'} # type: ignore - def _delete_async_relative_retry_invalid_json_polling_initial( self, **kwargs # type: Any @@ -2380,7 +2358,7 @@ def begin_delete_async_relative_retry_invalid_json_polling( indicated in the Azure-AsyncOperation header for operation status. :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2423,7 +2401,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_delete_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/deleteasync/retry/invalidjsonpolling'} # type: ignore - def _post202_retry_invalid_header_initial( self, product=None, # type: Optional["models.Product"] @@ -2483,7 +2460,7 @@ def begin_post202_retry_invalid_header( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2527,7 +2504,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post202_retry_invalid_header.metadata = {'url': '/lro/error/post/202/retry/invalidheader'} # type: ignore - def _post_async_relative_retry_invalid_header_initial( self, product=None, # type: Optional["models.Product"] @@ -2589,7 +2565,7 @@ def begin_post_async_relative_retry_invalid_header( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2633,7 +2609,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_invalid_header.metadata = {'url': '/lro/error/postasync/retry/invalidheader'} # type: ignore - def _post_async_relative_retry_invalid_json_polling_initial( self, product=None, # type: Optional["models.Product"] @@ -2695,7 +2670,7 @@ def begin_post_async_relative_retry_invalid_json_polling( :param product: Product to put. :type product: ~lro.models.Product :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -2738,4 +2713,3 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_post_async_relative_retry_invalid_json_polling.metadata = {'url': '/lro/error/postasync/retry/invalidjsonpolling'} # type: ignore - From cedac73aab68ea58d5d88dc7d047fb9f1ec0e684 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Thu, 21 May 2020 18:56:58 -0400 Subject: [PATCH 11/26] added continuation_token to reserved parameters --- autorest/namer/python_mappings.py | 1 + test/unittests/test_name_converter.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/autorest/namer/python_mappings.py b/autorest/namer/python_mappings.py index 3e84cd2d9c3..28c5e49a73e 100644 --- a/autorest/namer/python_mappings.py +++ b/autorest/namer/python_mappings.py @@ -102,6 +102,7 @@ class PadType(Enum): "content_type", "cls", "polling", + "continuation_token", # for LRO calls # these are transport kwargs # https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#transport "connection_timeout", diff --git a/test/unittests/test_name_converter.py b/test/unittests/test_name_converter.py index 0bd38e06f4b..0ac6b070638 100644 --- a/test/unittests/test_name_converter.py +++ b/test/unittests/test_name_converter.py @@ -22,14 +22,16 @@ def test_escaped_reserved_words(): "content_type": "content_type_parameter", "request_id": "request_id_parameter", "elif": "elif_parameter", - "self": "self_parameter" + "self": "self_parameter", + "continuation_token": "continuation_token_parameter" } for name in expected_conversion_parameter: assert NameConverter._to_valid_python_name(name, pad_string=PadType.Parameter) == expected_conversion_parameter[name] expected_conversion_enum = { "self": "self", - "mro": "mro_enum" + "mro": "mro_enum", + "continuation_token": "continuation_token" } for name in expected_conversion_enum: assert NameConverter._to_valid_python_name(name, pad_string=PadType.Enum) == expected_conversion_enum[name] \ No newline at end of file From a7f46af160a6a1db101c2d25c60dace7cfd01e4c Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 22 May 2020 11:28:18 -0700 Subject: [PATCH 12/26] Making it a 5.1.0-preview.1 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6949f7c55da..1143fbe1a77 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@autorest/python", - "version": "5.0.0-preview.7", + "version": "5.1.0-preview.1", "description": "The Python extension for generators in AutoRest.", "scripts": { "prepare": "python prepare.py", @@ -37,4 +37,4 @@ "venvtools.py", "run-python3.js" ] -} +} \ No newline at end of file From 9dc1331c22ea302e8cd08ecab12ded91b4d00902 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 22 May 2020 12:08:22 -0700 Subject: [PATCH 13/26] 5.1.0 preview.1 changelog --- ChangeLog.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 7fcdd5cb82b..a31630b6e95 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,16 @@ # Change Log +### 2020-05-22 - 5.1.0-preview.1 +Modelerfour version: 4.13.351 + +**Disclaimer** + +This version requires azure-core 1.6.0 and contains features and bugfixes 5.0.0-preview.8 + +**Features** + +- Refactor async LRO poller with a AsyncLROPoller class + "begin_" prefix + ### 2020-05-22 - 5.0.0-preview.8 Modelerfour version: 4.13.351 From 77151cf5e977bec5dac8e8bee8fcc6e1cc8e470a Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 22 May 2020 17:45:49 -0700 Subject: [PATCH 14/26] Update dependencies --- test/azure/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/azure/requirements.txt b/test/azure/requirements.txt index b7758bfec5d..ec0c0f3ced7 100644 --- a/test/azure/requirements.txt +++ b/test/azure/requirements.txt @@ -3,8 +3,8 @@ pytest pytest-cov pytest-asyncio==0.10.0;python_full_version>="3.5.2" async_generator;python_full_version>="3.5.2" -git+https://github.com/Azure/azure-sdk-for-python@lro_continuation_token#subdirectory=sdk/core/azure-core&egg=azure-core -git+https://github.com/Azure/azure-sdk-for-python@lro_continuation_token#subdirectory=sdk/core/azure-mgmt-core&egg=azure-mgmt-core +git+https://github.com/Azure/azure-sdk-for-python#subdirectory=sdk/core/azure-core&egg=azure-core +azure-mgmt-core>=1.1.0 msrest>=0.6.10 aiohttp;python_full_version>="3.5.2" -e ./Expected/AcceptanceTests/AzureBodyDuration From 905a1d0c539ae41e827bf2ed563d8e32a5ea6232 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 22 May 2020 17:56:19 -0700 Subject: [PATCH 15/26] Fix more tests --- test/azure/AcceptanceTests/asynctests/test_paging.py | 3 ++- test/azure/AcceptanceTests/asynctests/test_tracing.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/azure/AcceptanceTests/asynctests/test_paging.py b/test/azure/AcceptanceTests/asynctests/test_paging.py index cb9dfb5fb49..ca066ac8be4 100644 --- a/test/azure/AcceptanceTests/asynctests/test_paging.py +++ b/test/azure/AcceptanceTests/asynctests/test_paging.py @@ -219,7 +219,8 @@ async def test_get_multiple_pages_lro(client): polling = AsyncARMPolling(0, lro_options={'final-state-via': 'location'}) # FIXME Location should be the default once 1.0.0b2 is out - page1 = await client.paging.get_multiple_pages_lro(polling=polling) + poller = await client.paging.begin_get_multiple_pages_lro(polling=polling) + page1 = await poller.result() assert len(page1.values) == 1 assert page1.values[0].properties.id == 1 assert page1.next_link.endswith("paging/multiple/page/2") diff --git a/test/azure/AcceptanceTests/asynctests/test_tracing.py b/test/azure/AcceptanceTests/asynctests/test_tracing.py index e4335261dec..d6ae7daad31 100644 --- a/test/azure/AcceptanceTests/asynctests/test_tracing.py +++ b/test/azure/AcceptanceTests/asynctests/test_tracing.py @@ -53,8 +53,7 @@ async def test_paging(): async def test_lro(): async with AutoRestLongRunningOperationTestService("cred", base_url="dummy url") as client: assert not has_tracing_decorator(client.lros._put201_creating_succeeded200_initial) - assert has_tracing_decorator(client.lros.put201_creating_succeeded200) - assert not has_tracing_decorator(client.lros._put201_creating_succeeded200_initial) + assert has_tracing_decorator(client.lros.begin_put201_creating_succeeded200) def test_azure_url(): From 31086bfaabfe93e74887249cfebc068a9618bcff Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 22 May 2020 18:04:52 -0700 Subject: [PATCH 16/26] Regenerate --- package.json | 2 +- .../_paging_operations_async.py | 31 +++++++++++------ .../paging/operations/_paging_operations.py | 25 ++++++++++---- .../_storage_accounts_operations_async.py | 33 ++++++++++++------- .../_storage_accounts_operations.py | 27 ++++++++++----- .../Multiapi/multiapi/v1/_metadata.json | 2 +- ...ultiapi_service_client_operations_async.py | 29 +++++++++++----- .../_multiapi_service_client_operations.py | 23 +++++++++---- .../multiapinoasync/v1/_metadata.json | 2 +- .../_multiapi_service_client_operations.py | 23 +++++++++---- .../submodule/v1/_metadata.json | 2 +- ...ultiapi_service_client_operations_async.py | 29 +++++++++++----- .../_multiapi_service_client_operations.py | 23 +++++++++---- 13 files changed, 175 insertions(+), 76 deletions(-) diff --git a/package.json b/package.json index 1143fbe1a77..a59e7f915e3 100644 --- a/package.json +++ b/package.json @@ -37,4 +37,4 @@ "venvtools.py", "run-python3.js" ] -} \ No newline at end of file +} diff --git a/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py b/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py index 6c969876e16..f47473c0fa0 100644 --- a/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat @@ -1021,7 +1021,7 @@ async def _get_multiple_pages_lro_initial( _get_multiple_pages_lro_initial.metadata = {'url': '/paging/multiple/lro'} # type: ignore @distributed_trace_async - async def get_multiple_pages_lro( + async def begin_get_multiple_pages_lro( self, client_request_id: Optional[str] = None, paging_get_multiple_pages_lro_options: Optional["models.PagingGetMultiplePagesLroOptions"] = None, @@ -1034,6 +1034,7 @@ async def get_multiple_pages_lro( :param paging_get_multiple_pages_lro_options: Parameter group. :type paging_get_multiple_pages_lro_options: ~paging.models.PagingGetMultiplePagesLroOptions :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -1048,12 +1049,14 @@ async def get_multiple_pages_lro( 'polling_interval', self._config.polling_interval ) - raw_result = await self._get_multiple_pages_lro_initial( - client_request_id=client_request_id, - paging_get_multiple_pages_lro_options=paging_get_multiple_pages_lro_options, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_multiple_pages_lro_initial( + client_request_id=client_request_id, + paging_get_multiple_pages_lro_options=paging_get_multiple_pages_lro_options, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -1068,5 +1071,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - get_multiple_pages_lro.metadata = {'url': '/paging/multiple/lro'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get_multiple_pages_lro.metadata = {'url': '/paging/multiple/lro'} # type: ignore diff --git a/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py b/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py index 32c705d15ab..86638a4ff27 100644 --- a/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py +++ b/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py @@ -1053,6 +1053,7 @@ def begin_get_multiple_pages_lro( :param paging_get_multiple_pages_lro_options: Parameter group. :type paging_get_multiple_pages_lro_options: ~paging.models.PagingGetMultiplePagesLroOptions :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -1067,12 +1068,14 @@ def begin_get_multiple_pages_lro( 'polling_interval', self._config.polling_interval ) - raw_result = self._get_multiple_pages_lro_initial( - client_request_id=client_request_id, - paging_get_multiple_pages_lro_options=paging_get_multiple_pages_lro_options, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_multiple_pages_lro_initial( + client_request_id=client_request_id, + paging_get_multiple_pages_lro_options=paging_get_multiple_pages_lro_options, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -1087,5 +1090,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_get_multiple_pages_lro.metadata = {'url': '/paging/multiple/lro'} # type: ignore diff --git a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations_async/_storage_accounts_operations_async.py b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations_async/_storage_accounts_operations_async.py index 759d38466e4..96f2c036621 100644 --- a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations_async/_storage_accounts_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations_async/_storage_accounts_operations_async.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat @@ -160,7 +160,7 @@ async def _create_initial( _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore @distributed_trace_async - async def create( + async def begin_create( self, resource_group_name: str, account_name: str, @@ -181,6 +181,7 @@ async def create( :param parameters: The parameters to provide for the created account. :type parameters: ~storage.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -195,13 +196,15 @@ async def create( 'polling_interval', self._config.polling_interval ) - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -216,8 +219,16 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore @distributed_trace_async async def delete( diff --git a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py index 4b90634be09..1b90aa5b9ef 100644 --- a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py +++ b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py @@ -187,6 +187,7 @@ def begin_create( :param parameters: The parameters to provide for the created account. :type parameters: ~storage.models.StorageAccountCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -201,13 +202,15 @@ def begin_create( 'polling_interval', self._config.polling_interval ) - raw_result = self._create_initial( - resource_group_name=resource_group_name, - account_name=account_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -222,7 +225,15 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'} # type: ignore @distributed_trace diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json index da28e75e0f7..5ae7064e457 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json @@ -76,5 +76,5 @@ } }, "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.core.polling import LROPoller, NoPolling, PollingMethod\nfrom azure.core.polling.base_polling import LROBasePolling\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller\nfrom azure.core.polling.async_base_polling import AsyncLROBasePolling" + "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod\nfrom azure.core.polling.async_base_polling import AsyncLROBasePolling" } \ No newline at end of file diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations_async/_multiapi_service_client_operations_async.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations_async/_multiapi_service_client_operations_async.py index d5c0d0fbdd8..8f44bc04f80 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations_async/_multiapi_service_client_operations_async.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations_async/_multiapi_service_client_operations_async.py @@ -11,7 +11,7 @@ from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.polling.async_base_polling import AsyncLROBasePolling from ... import models @@ -119,7 +119,7 @@ async def _test_lro_initial( return deserialized _test_lro_initial.metadata = {'url': '/multiapi/lro'} # type: ignore - async def test_lro( + async def begin_test_lro( self, product: Optional["models.Product"] = None, **kwargs @@ -129,6 +129,7 @@ async def test_lro( :param product: Product to put. :type product: ~multiapi.v1.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -143,11 +144,13 @@ async def test_lro( 'polling_interval', self._config.polling_interval ) - raw_result = await self._test_lro_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._test_lro_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -162,5 +165,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncLROBasePolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - test_lro.metadata = {'url': '/multiapi/lro'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_test_lro.metadata = {'url': '/multiapi/lro'} # type: ignore diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py index 7022122ecc6..4485e7eadb0 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py @@ -136,6 +136,7 @@ def begin_test_lro( :param product: Product to put. :type product: ~multiapi.v1.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -150,11 +151,13 @@ def begin_test_lro( 'polling_interval', self._config.polling_interval ) - raw_result = self._test_lro_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._test_lro_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -169,5 +172,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = LROBasePolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_test_lro.metadata = {'url': '/multiapi/lro'} # type: ignore diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json index 13d316b5b54..4af2a4e2659 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json @@ -76,5 +76,5 @@ } }, "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.core.polling import LROPoller, NoPolling, PollingMethod\nfrom azure.core.polling.base_polling import LROBasePolling\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller\nfrom azure.core.polling.async_base_polling import AsyncLROBasePolling" + "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod\nfrom azure.core.polling.async_base_polling import AsyncLROBasePolling" } \ No newline at end of file diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py index aec83d743b0..a78c42fb10d 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py @@ -136,6 +136,7 @@ def begin_test_lro( :param product: Product to put. :type product: ~multiapinoasync.v1.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -150,11 +151,13 @@ def begin_test_lro( 'polling_interval', self._config.polling_interval ) - raw_result = self._test_lro_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._test_lro_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -169,5 +172,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = LROBasePolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_test_lro.metadata = {'url': '/multiapi/lro'} # type: ignore diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json index 76bbd74decf..4df1f0d992d 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json @@ -76,5 +76,5 @@ } }, "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.core.polling import LROPoller, NoPolling, PollingMethod\nfrom azure.core.polling.base_polling import LROBasePolling\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller\nfrom azure.core.polling.async_base_polling import AsyncLROBasePolling" + "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod\nfrom azure.core.polling.async_base_polling import AsyncLROBasePolling" } \ No newline at end of file diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations_async/_multiapi_service_client_operations_async.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations_async/_multiapi_service_client_operations_async.py index 1ecf28682de..b729f2581f9 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations_async/_multiapi_service_client_operations_async.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations_async/_multiapi_service_client_operations_async.py @@ -11,7 +11,7 @@ from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncNoPolling, AsyncPollingMethod, async_poller +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.polling.async_base_polling import AsyncLROBasePolling from ... import models @@ -119,7 +119,7 @@ async def _test_lro_initial( return deserialized _test_lro_initial.metadata = {'url': '/multiapi/lro'} # type: ignore - async def test_lro( + async def begin_test_lro( self, product: Optional["models.Product"] = None, **kwargs @@ -129,6 +129,7 @@ async def test_lro( :param product: Product to put. :type product: ~multiapiwithsubmodule.submodule.v1.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod @@ -143,11 +144,13 @@ async def test_lro( 'polling_interval', self._config.polling_interval ) - raw_result = await self._test_lro_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._test_lro_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -162,5 +165,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = AsyncLROBasePolling(lro_delay, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling - return await async_poller(self._client, raw_result, get_long_running_output, polling_method) - test_lro.metadata = {'url': '/multiapi/lro'} # type: ignore + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_test_lro.metadata = {'url': '/multiapi/lro'} # type: ignore diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py index 65a9decd18f..b6573ec26f5 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py @@ -136,6 +136,7 @@ def begin_test_lro( :param product: Product to put. :type product: ~multiapiwithsubmodule.submodule.v1.models.Product :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.PollingMethod @@ -150,11 +151,13 @@ def begin_test_lro( 'polling_interval', self._config.polling_interval ) - raw_result = self._test_lro_initial( - product=product, - cls=lambda x,y,z: x, - **kwargs - ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._test_lro_initial( + product=product, + cls=lambda x,y,z: x, + **kwargs + ) kwargs.pop('error_map', None) kwargs.pop('content_type', None) @@ -169,5 +172,13 @@ def get_long_running_output(pipeline_response): if polling is True: polling_method = LROBasePolling(lro_delay, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_test_lro.metadata = {'url': '/multiapi/lro'} # type: ignore From a2238047c121a1797a02f5ce4fbac56bb2346235 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Fri, 22 May 2020 18:38:34 -0700 Subject: [PATCH 17/26] More dep changes --- test/multiapi/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/multiapi/requirements.txt b/test/multiapi/requirements.txt index e5650cc785e..7147f610d10 100644 --- a/test/multiapi/requirements.txt +++ b/test/multiapi/requirements.txt @@ -1,6 +1,6 @@ msrest>=0.6.11 -azure-core>=1.3.0 -azure-mgmt-core +git+https://github.com/Azure/azure-sdk-for-python#subdirectory=sdk/core/azure-core&egg=azure-core +azure-mgmt-core>=1.1.0 pytest pytest-asyncio==0.10.0;python_full_version>="3.5.2" async_generator;python_full_version>="3.5.2" From 74ef61229ad72843f4ed90c78847682e28c895f4 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Tue, 26 May 2020 11:30:23 -0400 Subject: [PATCH 18/26] fixed async docs and typing --- .../codegen/templates/lro_operation.py.jinja2 | 6 +- .../_lr_os_custom_header_operations_async.py | 24 +- .../_lro_retrys_operations_async.py | 42 +-- .../_lros_operations_async.py | 246 +++++++++--------- .../_lrosads_operations_async.py | 156 +++++------ .../_paging_operations_async.py | 6 +- .../_storage_accounts_operations_async.py | 6 +- ...ultiapi_service_client_operations_async.py | 6 +- ...ultiapi_service_client_operations_async.py | 6 +- 9 files changed, 249 insertions(+), 249 deletions(-) diff --git a/autorest/codegen/templates/lro_operation.py.jinja2 b/autorest/codegen/templates/lro_operation.py.jinja2 index 4b69dbee961..7727e4fa676 100644 --- a/autorest/codegen/templates/lro_operation.py.jinja2 +++ b/autorest/codegen/templates/lro_operation.py.jinja2 @@ -5,8 +5,8 @@ {% set poller = "AsyncLROPoller" if async_mode else "LROPoller" %} {% set operation_name = "begin_"+operation.python_name %} {% macro return_docstring() %} -:return: {{ "" if async_mode else "An instance of LROPoller that returns either " }}{{ operation.responses[0].schema.docstring_text if operation.responses[0].has_body else "None"}}{{ "," if async_mode }} or the result of cls(response) -:rtype: {{"" if async_mode else "~azure.core.polling.LROPoller["}}{{ operation.responses[0].schema.docstring_type if operation.responses[0].has_body else "None" }}{{ "" if async_mode else "]" }}{% endmacro %} +:return: An instance of {{ "Async" if async_mode }}LROPoller that returns either {{ operation.responses[0].schema.docstring_text if operation.responses[0].has_body else "None"}} or the result of cls(response) +:rtype: ~azure.core.polling.{{ "Async" if async_mode }}LROPoller[{{ operation.responses[0].schema.docstring_type if operation.responses[0].has_body else "None" }}]{% endmacro %} {% macro param_documentation_string(parameter) %}:param {{ parameter.serialized_name }}: {{ parameter.description }}{% endmacro %} {% macro response_headers(response) %} response_headers = { @@ -20,7 +20,7 @@ response_headers = { {% if code_model.options['tracing'] %} {{ trace_decorator }} {% endif %} -{% set return_type_wrapper = "" if async_mode else "LROPoller" %} +{% set return_type_wrapper = "AsyncLROPoller" if async_mode else "LROPoller" %} {{ op_tools.method_signature(operation, operation_name, async_mode=async_mode, coroutine=async_mode, return_type_wrapper=return_type_wrapper) }} {%- if not async_mode %} {# overriding sync_return_type_annotation because we know if it's sync, it's return type is just LROPoller #} diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py index f733757f00e..36a2c87ed9a 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py @@ -97,7 +97,7 @@ async def begin_put_async_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- @@ -111,8 +111,8 @@ async def begin_put_async_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -213,7 +213,7 @@ async def begin_put201_creating_succeeded200( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll @@ -227,8 +227,8 @@ async def begin_put201_creating_succeeded200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +319,7 @@ async def begin_post202_retry200( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. @@ -332,8 +332,8 @@ async def begin_post202_retry200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -422,7 +422,7 @@ async def begin_post_async_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- @@ -436,8 +436,8 @@ async def begin_post_async_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py index 880f701ff66..02f33682797 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py @@ -98,7 +98,7 @@ async def begin_put201_creating_succeeded200( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -111,8 +111,8 @@ async def begin_put201_creating_succeeded200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +207,7 @@ async def begin_put_async_relative_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- AsyncOperation header for operation status. @@ -220,8 +220,8 @@ async def begin_put_async_relative_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -314,7 +314,7 @@ async def _delete_provisioning202_accepted200_succeeded_initial( async def begin_delete_provisioning202_accepted200_succeeded( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -325,8 +325,8 @@ async def begin_delete_provisioning202_accepted200_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -409,7 +409,7 @@ async def _delete202_retry200_initial( async def begin_delete202_retry200( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -419,8 +419,8 @@ async def begin_delete202_retry200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -497,7 +497,7 @@ async def _delete_async_relative_retry_succeeded_initial( async def begin_delete_async_relative_retry_succeeded( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -507,8 +507,8 @@ async def begin_delete_async_relative_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -595,7 +595,7 @@ async def begin_post202_retry200( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. @@ -607,8 +607,8 @@ async def begin_post202_retry200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -697,7 +697,7 @@ async def begin_post_async_relative_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- AsyncOperation header for operation status. @@ -710,8 +710,8 @@ async def begin_post_async_relative_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py index 37ca98390ab..2186491c006 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py @@ -95,7 +95,7 @@ async def begin_put200_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. @@ -107,8 +107,8 @@ async def begin_put200_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -199,7 +199,7 @@ async def begin_put201_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. @@ -211,8 +211,8 @@ async def begin_put201_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -299,7 +299,7 @@ async def _post202_list_initial( async def begin_post202_list( self, **kwargs - ) -> List["models.Product"]: + ) -> AsyncLROPoller[List["models.Product"]]: """Long running put request, service returns a 202 with empty body to first request, returns a 200 with body [{ 'id': '100', 'name': 'foo' }]. @@ -309,8 +309,8 @@ async def begin_post202_list( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: list of Product, or the result of cls(response) - :rtype: list[~lro.models.Product] + :return: An instance of AsyncLROPoller that returns either list of Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[list[~lro.models.Product]] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -400,7 +400,7 @@ async def begin_put200_succeeded_no_state( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. @@ -412,8 +412,8 @@ async def begin_put200_succeeded_no_state( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -504,7 +504,7 @@ async def begin_put202_retry200( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. @@ -517,8 +517,8 @@ async def begin_put202_retry200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -614,7 +614,7 @@ async def begin_put201_creating_succeeded200( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -627,8 +627,8 @@ async def begin_put201_creating_succeeded200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -719,7 +719,7 @@ async def begin_put200_updating_succeeded204( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -732,8 +732,8 @@ async def begin_put200_updating_succeeded204( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -829,7 +829,7 @@ async def begin_put201_creating_failed200( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. @@ -842,8 +842,8 @@ async def begin_put201_creating_failed200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -934,7 +934,7 @@ async def begin_put200_acceptedcanceled200( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. @@ -947,8 +947,8 @@ async def begin_put200_acceptedcanceled200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1041,7 +1041,7 @@ async def begin_put_no_header_in_retry( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. @@ -1053,8 +1053,8 @@ async def begin_put_no_header_in_retry( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1152,7 +1152,7 @@ async def begin_put_async_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1165,8 +1165,8 @@ async def begin_put_async_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1265,7 +1265,7 @@ async def begin_put_async_no_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1278,8 +1278,8 @@ async def begin_put_async_no_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1378,7 +1378,7 @@ async def begin_put_async_retry_failed( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1391,8 +1391,8 @@ async def begin_put_async_retry_failed( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1491,7 +1491,7 @@ async def begin_put_async_no_retrycanceled( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1504,8 +1504,8 @@ async def begin_put_async_no_retrycanceled( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1602,7 +1602,7 @@ async def begin_put_async_no_header_in_retry( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 202 to the initial request with Azure- AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. @@ -1615,8 +1615,8 @@ async def begin_put_async_no_header_in_retry( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1710,7 +1710,7 @@ async def begin_put_non_resource( self, sku: Optional["models.Sku"] = None, **kwargs - ) -> "models.Sku": + ) -> AsyncLROPoller["models.Sku"]: """Long running put request with non resource. :param sku: sku to put. @@ -1721,8 +1721,8 @@ async def begin_put_non_resource( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Sku, or the result of cls(response) - :rtype: ~lro.models.Sku + :return: An instance of AsyncLROPoller that returns either Sku or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Sku] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1813,7 +1813,7 @@ async def begin_put_async_non_resource( self, sku: Optional["models.Sku"] = None, **kwargs - ) -> "models.Sku": + ) -> AsyncLROPoller["models.Sku"]: """Long running put request with non resource. :param sku: Sku to put. @@ -1824,8 +1824,8 @@ async def begin_put_async_non_resource( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Sku, or the result of cls(response) - :rtype: ~lro.models.Sku + :return: An instance of AsyncLROPoller that returns either Sku or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Sku] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1918,7 +1918,7 @@ async def begin_put_sub_resource( self, provisioning_state: Optional[str] = None, **kwargs - ) -> "models.SubProduct": + ) -> AsyncLROPoller["models.SubProduct"]: """Long running put request with sub resource. :param provisioning_state: @@ -1929,8 +1929,8 @@ async def begin_put_sub_resource( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: SubProduct, or the result of cls(response) - :rtype: ~lro.models.SubProduct + :return: An instance of AsyncLROPoller that returns either SubProduct or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.SubProduct] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2023,7 +2023,7 @@ async def begin_put_async_sub_resource( self, provisioning_state: Optional[str] = None, **kwargs - ) -> "models.SubProduct": + ) -> AsyncLROPoller["models.SubProduct"]: """Long running put request with sub resource. :param provisioning_state: @@ -2034,8 +2034,8 @@ async def begin_put_async_sub_resource( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: SubProduct, or the result of cls(response) - :rtype: ~lro.models.SubProduct + :return: An instance of AsyncLROPoller that returns either SubProduct or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.SubProduct] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2123,7 +2123,7 @@ async def _delete_provisioning202_accepted200_succeeded_initial( async def begin_delete_provisioning202_accepted200_succeeded( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2134,8 +2134,8 @@ async def begin_delete_provisioning202_accepted200_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2226,7 +2226,7 @@ async def _delete_provisioning202_deleting_failed200_initial( async def begin_delete_provisioning202_deleting_failed200( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. @@ -2237,8 +2237,8 @@ async def begin_delete_provisioning202_deleting_failed200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2329,7 +2329,7 @@ async def _delete_provisioning202_deletingcanceled200_initial( async def begin_delete_provisioning202_deletingcanceled200( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. @@ -2340,8 +2340,8 @@ async def begin_delete_provisioning202_deletingcanceled200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2420,7 +2420,7 @@ async def _delete204_succeeded_initial( async def begin_delete204_succeeded( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete succeeds and returns right away. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2429,8 +2429,8 @@ async def begin_delete204_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2513,7 +2513,7 @@ async def _delete202_retry200_initial( async def begin_delete202_retry200( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2523,8 +2523,8 @@ async def begin_delete202_retry200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2610,7 +2610,7 @@ async def _delete202_no_retry204_initial( async def begin_delete202_no_retry204( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2620,8 +2620,8 @@ async def begin_delete202_no_retry204( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2700,7 +2700,7 @@ async def _delete_no_header_in_retry_initial( async def begin_delete_no_header_in_retry( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. @@ -2710,8 +2710,8 @@ async def begin_delete_no_header_in_retry( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2787,7 +2787,7 @@ async def _delete_async_no_header_in_retry_initial( async def begin_delete_async_no_header_in_retry( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. @@ -2797,8 +2797,8 @@ async def begin_delete_async_no_header_in_retry( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2875,7 +2875,7 @@ async def _delete_async_retry_succeeded_initial( async def begin_delete_async_retry_succeeded( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2885,8 +2885,8 @@ async def begin_delete_async_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2963,7 +2963,7 @@ async def _delete_async_no_retry_succeeded_initial( async def begin_delete_async_no_retry_succeeded( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2973,8 +2973,8 @@ async def begin_delete_async_no_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3051,7 +3051,7 @@ async def _delete_async_retry_failed_initial( async def begin_delete_async_retry_failed( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3061,8 +3061,8 @@ async def begin_delete_async_retry_failed( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3139,7 +3139,7 @@ async def _delete_async_retrycanceled_initial( async def begin_delete_async_retrycanceled( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3149,8 +3149,8 @@ async def begin_delete_async_retrycanceled( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3231,7 +3231,7 @@ async def _post200_with_payload_initial( async def begin_post200_with_payload( self, **kwargs - ) -> "models.Sku": + ) -> AsyncLROPoller["models.Sku"]: """Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. @@ -3241,8 +3241,8 @@ async def begin_post200_with_payload( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Sku, or the result of cls(response) - :rtype: ~lro.models.Sku + :return: An instance of AsyncLROPoller that returns either Sku or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Sku] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3332,7 +3332,7 @@ async def begin_post202_retry200( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. @@ -3344,8 +3344,8 @@ async def begin_post202_retry200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3436,7 +3436,7 @@ async def begin_post202_no_retry204( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. @@ -3448,8 +3448,8 @@ async def begin_post202_no_retry204( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3533,7 +3533,7 @@ async def _post_double_headers_final_location_get_initial( async def begin_post_double_headers_final_location_get( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should poll Location to get the final object. @@ -3544,8 +3544,8 @@ async def begin_post_double_headers_final_location_get( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3624,7 +3624,7 @@ async def _post_double_headers_final_azure_header_get_initial( async def begin_post_double_headers_final_azure_header_get( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object. @@ -3635,8 +3635,8 @@ async def begin_post_double_headers_final_azure_header_get( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3715,7 +3715,7 @@ async def _post_double_headers_final_azure_header_get_default_initial( async def begin_post_double_headers_final_azure_header_get_default( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object if you support initial Autorest behavior. @@ -3726,8 +3726,8 @@ async def begin_post_double_headers_final_azure_header_get_default( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3825,7 +3825,7 @@ async def begin_post_async_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3838,8 +3838,8 @@ async def begin_post_async_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3938,7 +3938,7 @@ async def begin_post_async_no_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3951,8 +3951,8 @@ async def begin_post_async_no_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -4044,7 +4044,7 @@ async def begin_post_async_retry_failed( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -4057,8 +4057,8 @@ async def begin_post_async_retry_failed( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -4147,7 +4147,7 @@ async def begin_post_async_retrycanceled( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -4160,8 +4160,8 @@ async def begin_post_async_retrycanceled( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py index 3533a151ed1..364e800e44b 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py @@ -98,7 +98,7 @@ async def begin_put_non_retry400( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 400 to the initial request. :param product: Product to put. @@ -109,8 +109,8 @@ async def begin_put_non_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -206,7 +206,7 @@ async def begin_put_non_retry201_creating400( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. @@ -218,8 +218,8 @@ async def begin_put_non_retry201_creating400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +315,7 @@ async def begin_put_non_retry201_creating400_invalid_json( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. @@ -327,8 +327,8 @@ async def begin_put_non_retry201_creating400_invalid_json( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -423,7 +423,7 @@ async def begin_put_async_relative_retry400( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -435,8 +435,8 @@ async def begin_put_async_relative_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -521,7 +521,7 @@ async def _delete_non_retry400_initial( async def begin_delete_non_retry400( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 400 with an error body. :keyword callable cls: A custom type or function that will be passed the direct response @@ -530,8 +530,8 @@ async def begin_delete_non_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -607,7 +607,7 @@ async def _delete202_non_retry400_initial( async def begin_delete202_non_retry400( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 with a location header. :keyword callable cls: A custom type or function that will be passed the direct response @@ -616,8 +616,8 @@ async def begin_delete202_non_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -694,7 +694,7 @@ async def _delete_async_relative_retry400_initial( async def begin_delete_async_relative_retry400( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -704,8 +704,8 @@ async def begin_delete_async_relative_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -792,7 +792,7 @@ async def begin_post_non_retry400( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 400 with no error body. :param product: Product to put. @@ -803,8 +803,8 @@ async def begin_post_non_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -892,7 +892,7 @@ async def begin_post202_non_retry400( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 with a location header. :param product: Product to put. @@ -903,8 +903,8 @@ async def begin_post202_non_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -993,7 +993,7 @@ async def begin_post_async_relative_retry400( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1005,8 +1005,8 @@ async def begin_post_async_relative_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1099,7 +1099,7 @@ async def begin_put_error201_no_provisioning_state_payload( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 201 to the initial request with no payload. :param product: Product to put. @@ -1110,8 +1110,8 @@ async def begin_put_error201_no_provisioning_state_payload( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1206,7 +1206,7 @@ async def begin_put_async_relative_retry_no_status( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1219,8 +1219,8 @@ async def begin_put_async_relative_retry_no_status( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1320,7 +1320,7 @@ async def begin_put_async_relative_retry_no_status_payload( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1333,8 +1333,8 @@ async def begin_put_async_relative_retry_no_status_payload( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1415,7 +1415,7 @@ async def _delete204_succeeded_initial( async def begin_delete204_succeeded( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 204 to the initial request, indicating success. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1424,8 +1424,8 @@ async def begin_delete204_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1502,7 +1502,7 @@ async def _delete_async_relative_retry_no_status_initial( async def begin_delete_async_relative_retry_no_status( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1512,8 +1512,8 @@ async def begin_delete_async_relative_retry_no_status( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1600,7 +1600,7 @@ async def begin_post202_no_location( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, without a location header. @@ -1612,8 +1612,8 @@ async def begin_post202_no_location( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1702,7 +1702,7 @@ async def begin_post_async_relative_retry_no_payload( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1715,8 +1715,8 @@ async def begin_post_async_relative_retry_no_payload( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1806,7 +1806,7 @@ async def begin_put200_invalid_json( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. @@ -1818,8 +1818,8 @@ async def begin_put200_invalid_json( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1914,7 +1914,7 @@ async def begin_put_async_relative_retry_invalid_header( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. @@ -1927,8 +1927,8 @@ async def begin_put_async_relative_retry_invalid_header( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2028,7 +2028,7 @@ async def begin_put_async_relative_retry_invalid_json_polling( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2041,8 +2041,8 @@ async def begin_put_async_relative_retry_invalid_json_polling( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2127,7 +2127,7 @@ async def _delete202_retry_invalid_header_initial( async def begin_delete202_retry_invalid_header( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. @@ -2137,8 +2137,8 @@ async def begin_delete202_retry_invalid_header( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2215,7 +2215,7 @@ async def _delete_async_relative_retry_invalid_header_initial( async def begin_delete_async_relative_retry_invalid_header( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. @@ -2225,8 +2225,8 @@ async def begin_delete_async_relative_retry_invalid_header( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2303,7 +2303,7 @@ async def _delete_async_relative_retry_invalid_json_polling_initial( async def begin_delete_async_relative_retry_invalid_json_polling( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2313,8 +2313,8 @@ async def begin_delete_async_relative_retry_invalid_json_polling( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2401,7 +2401,7 @@ async def begin_post202_retry_invalid_header( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. @@ -2413,8 +2413,8 @@ async def begin_post202_retry_invalid_header( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2503,7 +2503,7 @@ async def begin_post_async_relative_retry_invalid_header( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. @@ -2516,8 +2516,8 @@ async def begin_post_async_relative_retry_invalid_header( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2606,7 +2606,7 @@ async def begin_post_async_relative_retry_invalid_json_polling( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2619,8 +2619,8 @@ async def begin_post_async_relative_retry_invalid_json_polling( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py b/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py index f47473c0fa0..b1810244c5d 100644 --- a/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py @@ -1026,7 +1026,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 - ) -> "models.ProductResult": + ) -> AsyncLROPoller["models.ProductResult"]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -1039,8 +1039,8 @@ async def begin_get_multiple_pages_lro( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: ProductResult, or the result of cls(response) - :rtype: ~paging.models.ProductResult + :return: An instance of AsyncLROPoller that returns either ProductResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~paging.models.ProductResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations_async/_storage_accounts_operations_async.py b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations_async/_storage_accounts_operations_async.py index 96f2c036621..5fa3b106a73 100644 --- a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations_async/_storage_accounts_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations_async/_storage_accounts_operations_async.py @@ -166,7 +166,7 @@ async def begin_create( account_name: str, parameters: "models.StorageAccountCreateParameters", **kwargs - ) -> "models.StorageAccount": + ) -> AsyncLROPoller["models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. Existing accounts cannot be updated with this API and should instead use the Update Storage Account API. If an account is already created and subsequent PUT request is issued with exact same set of @@ -186,8 +186,8 @@ async def begin_create( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: StorageAccount, or the result of cls(response) - :rtype: ~storage.models.StorageAccount + :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~storage.models.StorageAccount] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations_async/_multiapi_service_client_operations_async.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations_async/_multiapi_service_client_operations_async.py index 8f44bc04f80..cf974a74994 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations_async/_multiapi_service_client_operations_async.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations_async/_multiapi_service_client_operations_async.py @@ -123,7 +123,7 @@ async def begin_test_lro( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -134,8 +134,8 @@ async def begin_test_lro( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~multiapi.v1.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~multiapi.v1.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations_async/_multiapi_service_client_operations_async.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations_async/_multiapi_service_client_operations_async.py index b729f2581f9..a0e22fc7e70 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations_async/_multiapi_service_client_operations_async.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations_async/_multiapi_service_client_operations_async.py @@ -123,7 +123,7 @@ async def begin_test_lro( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -134,8 +134,8 @@ async def begin_test_lro( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~multiapiwithsubmodule.submodule.v1.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~multiapiwithsubmodule.submodule.v1.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] From 08d3953fec218c6019ee12221b30e8ad1f251436 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Tue, 26 May 2020 11:36:20 -0400 Subject: [PATCH 19/26] added return type to LROPoller sync typing --- .../codegen/templates/lro_operation.py.jinja2 | 3 +- .../_lr_os_custom_header_operations.py | 8 +- .../lro/operations/_lro_retrys_operations.py | 14 ++-- .../Lro/lro/operations/_lros_operations.py | 82 +++++++++---------- .../Lro/lro/operations/_lrosads_operations.py | 52 ++++++------ .../paging/operations/_paging_operations.py | 2 +- .../_storage_accounts_operations.py | 2 +- .../_multiapi_service_client_operations.py | 2 +- .../_multiapi_service_client_operations.py | 2 +- .../_multiapi_service_client_operations.py | 2 +- 10 files changed, 84 insertions(+), 85 deletions(-) diff --git a/autorest/codegen/templates/lro_operation.py.jinja2 b/autorest/codegen/templates/lro_operation.py.jinja2 index 7727e4fa676..7a5c98b6849 100644 --- a/autorest/codegen/templates/lro_operation.py.jinja2 +++ b/autorest/codegen/templates/lro_operation.py.jinja2 @@ -23,8 +23,7 @@ response_headers = { {% set return_type_wrapper = "AsyncLROPoller" if async_mode else "LROPoller" %} {{ op_tools.method_signature(operation, operation_name, async_mode=async_mode, coroutine=async_mode, return_type_wrapper=return_type_wrapper) }} {%- if not async_mode %} -{# overriding sync_return_type_annotation because we know if it's sync, it's return type is just LROPoller #} - # type: (...) -> LROPoller + {{ op_tools.sync_return_type_annotation(operation, return_type_wrapper) }} {% endif %} """{{ operation.summary if operation.summary else operation.description | wordwrap(width=95, break_long_words=False, wrapstring='\n') }} {% if operation.summary and operation.description %} diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py index 4fbd3ed5f9b..3b42c68efde 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py @@ -103,7 +103,7 @@ def begin_put_async_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- @@ -221,7 +221,7 @@ def begin_put201_creating_succeeded200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll @@ -329,7 +329,7 @@ def begin_post202_retry200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. @@ -434,7 +434,7 @@ def begin_post_async_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py index 005103e8602..c574ba82e58 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py @@ -104,7 +104,7 @@ def begin_put201_creating_succeeded200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -215,7 +215,7 @@ def begin_put_async_relative_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- AsyncOperation header for operation status. @@ -324,7 +324,7 @@ def begin_delete_provisioning202_accepted200_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -421,7 +421,7 @@ def begin_delete202_retry200( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -511,7 +511,7 @@ def begin_delete_async_relative_retry_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -611,7 +611,7 @@ def begin_post202_retry200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. @@ -715,7 +715,7 @@ def begin_post_async_relative_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- AsyncOperation header for operation status. diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py index 431fbba40b6..a9e3f60120d 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py @@ -101,7 +101,7 @@ def begin_put200_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. @@ -207,7 +207,7 @@ def begin_put201_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. @@ -309,7 +309,7 @@ def begin_post202_list( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[List["models.Product"]] """Long running put request, service returns a 202 with empty body to first request, returns a 200 with body [{ 'id': '100', 'name': 'foo' }]. @@ -412,7 +412,7 @@ def begin_put200_succeeded_no_state( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. @@ -518,7 +518,7 @@ def begin_put202_retry200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. @@ -630,7 +630,7 @@ def begin_put201_creating_succeeded200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -737,7 +737,7 @@ def begin_put200_updating_succeeded204( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -849,7 +849,7 @@ def begin_put201_creating_failed200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. @@ -956,7 +956,7 @@ def begin_put200_acceptedcanceled200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. @@ -1065,7 +1065,7 @@ def begin_put_no_header_in_retry( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. @@ -1178,7 +1178,7 @@ def begin_put_async_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1293,7 +1293,7 @@ def begin_put_async_no_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1408,7 +1408,7 @@ def begin_put_async_retry_failed( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1523,7 +1523,7 @@ def begin_put_async_no_retrycanceled( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1636,7 +1636,7 @@ def begin_put_async_no_header_in_retry( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 202 to the initial request with Azure- AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. @@ -1746,7 +1746,7 @@ def begin_put_non_resource( sku=None, # type: Optional["models.Sku"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Sku"] """Long running put request with non resource. :param sku: sku to put. @@ -1851,7 +1851,7 @@ def begin_put_async_non_resource( sku=None, # type: Optional["models.Sku"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Sku"] """Long running put request with non resource. :param sku: Sku to put. @@ -1958,7 +1958,7 @@ def begin_put_sub_resource( provisioning_state=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.SubProduct"] """Long running put request with sub resource. :param provisioning_state: @@ -2065,7 +2065,7 @@ def begin_put_async_sub_resource( provisioning_state=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.SubProduct"] """Long running put request with sub resource. :param provisioning_state: @@ -2167,7 +2167,7 @@ def begin_delete_provisioning202_accepted200_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2272,7 +2272,7 @@ def begin_delete_provisioning202_deleting_failed200( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. @@ -2377,7 +2377,7 @@ def begin_delete_provisioning202_deletingcanceled200( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. @@ -2470,7 +2470,7 @@ def begin_delete204_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete succeeds and returns right away. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2565,7 +2565,7 @@ def begin_delete202_retry200( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2664,7 +2664,7 @@ def begin_delete202_no_retry204( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2756,7 +2756,7 @@ def begin_delete_no_header_in_retry( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. @@ -2845,7 +2845,7 @@ def begin_delete_async_no_header_in_retry( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. @@ -2935,7 +2935,7 @@ def begin_delete_async_retry_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3025,7 +3025,7 @@ def begin_delete_async_no_retry_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3115,7 +3115,7 @@ def begin_delete_async_retry_failed( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3205,7 +3205,7 @@ def begin_delete_async_retrycanceled( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3299,7 +3299,7 @@ def begin_post200_with_payload( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Sku"] """Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. @@ -3402,7 +3402,7 @@ def begin_post202_retry200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. @@ -3508,7 +3508,7 @@ def begin_post202_no_retry204( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. @@ -3607,7 +3607,7 @@ def begin_post_double_headers_final_location_get( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should poll Location to get the final object. @@ -3700,7 +3700,7 @@ def begin_post_double_headers_final_azure_header_get( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object. @@ -3793,7 +3793,7 @@ def begin_post_double_headers_final_azure_header_get_default( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object if you support initial Autorest behavior. @@ -3905,7 +3905,7 @@ def begin_post_async_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -4020,7 +4020,7 @@ def begin_post_async_no_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -4128,7 +4128,7 @@ def begin_post_async_retry_failed( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -4233,7 +4233,7 @@ def begin_post_async_retrycanceled( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py index 6018f3a552d..022da243859 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py @@ -104,7 +104,7 @@ def begin_put_non_retry400( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 400 to the initial request. :param product: Product to put. @@ -214,7 +214,7 @@ def begin_put_non_retry201_creating400( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. @@ -325,7 +325,7 @@ def begin_put_non_retry201_creating400_invalid_json( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. @@ -435,7 +435,7 @@ def begin_put_async_relative_retry400( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -535,7 +535,7 @@ def begin_delete_non_retry400( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 400 with an error body. :keyword callable cls: A custom type or function that will be passed the direct response @@ -623,7 +623,7 @@ def begin_delete202_non_retry400( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 with a location header. :keyword callable cls: A custom type or function that will be passed the direct response @@ -712,7 +712,7 @@ def begin_delete_async_relative_retry400( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -812,7 +812,7 @@ def begin_post_non_retry400( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 400 with no error body. :param product: Product to put. @@ -914,7 +914,7 @@ def begin_post202_non_retry400( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 with a location header. :param product: Product to put. @@ -1017,7 +1017,7 @@ def begin_post_async_relative_retry400( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1125,7 +1125,7 @@ def begin_put_error201_no_provisioning_state_payload( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 201 to the initial request with no payload. :param product: Product to put. @@ -1234,7 +1234,7 @@ def begin_put_async_relative_retry_no_status( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1350,7 +1350,7 @@ def begin_put_async_relative_retry_no_status_payload( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1447,7 +1447,7 @@ def begin_delete204_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 204 to the initial request, indicating success. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1536,7 +1536,7 @@ def begin_delete_async_relative_retry_no_status( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1636,7 +1636,7 @@ def begin_post202_no_location( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, without a location header. @@ -1740,7 +1740,7 @@ def begin_post_async_relative_retry_no_payload( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1846,7 +1846,7 @@ def begin_put200_invalid_json( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. @@ -1956,7 +1956,7 @@ def begin_put_async_relative_retry_invalid_header( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. @@ -2072,7 +2072,7 @@ def begin_put_async_relative_retry_invalid_json_polling( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2173,7 +2173,7 @@ def begin_delete202_retry_invalid_header( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. @@ -2263,7 +2263,7 @@ def begin_delete_async_relative_retry_invalid_header( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. @@ -2353,7 +2353,7 @@ def begin_delete_async_relative_retry_invalid_json_polling( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2453,7 +2453,7 @@ def begin_post202_retry_invalid_header( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. @@ -2557,7 +2557,7 @@ def begin_post_async_relative_retry_invalid_header( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. @@ -2662,7 +2662,7 @@ def begin_post_async_relative_retry_invalid_json_polling( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. diff --git a/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py b/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py index 86638a4ff27..dd9e42f1111 100644 --- a/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py +++ b/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py @@ -1045,7 +1045,7 @@ def begin_get_multiple_pages_lro( paging_get_multiple_pages_lro_options=None, # type: Optional["models.PagingGetMultiplePagesLroOptions"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ProductResult"] """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: diff --git a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py index 1b90aa5b9ef..a858f306771 100644 --- a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py +++ b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py @@ -172,7 +172,7 @@ def begin_create( parameters, # type: "models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.StorageAccount"] """Asynchronously creates a new storage account with the specified parameters. Existing accounts cannot be updated with this API and should instead use the Update Storage Account API. If an account is already created and subsequent PUT request is issued with exact same set of diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py index 4485e7eadb0..d2b493f502b 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py @@ -130,7 +130,7 @@ def begin_test_lro( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py index a78c42fb10d..b14ec738268 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py @@ -130,7 +130,7 @@ def begin_test_lro( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py index b6573ec26f5..b474c944d01 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py @@ -130,7 +130,7 @@ def begin_test_lro( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. From 4f1c3f87b570a7e34e6d6f583cd72c8c45c1c125 Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Tue, 26 May 2020 12:46:58 -0400 Subject: [PATCH 20/26] LRO continuation token typing and doc fixes (#645) * fixed async docs and typing * added return type to LROPoller sync typing --- .../codegen/templates/lro_operation.py.jinja2 | 9 +- .../_lr_os_custom_header_operations_async.py | 24 +- .../_lro_retrys_operations_async.py | 42 +-- .../_lros_operations_async.py | 246 +++++++++--------- .../_lrosads_operations_async.py | 156 +++++------ .../_lr_os_custom_header_operations.py | 8 +- .../lro/operations/_lro_retrys_operations.py | 14 +- .../Lro/lro/operations/_lros_operations.py | 82 +++--- .../Lro/lro/operations/_lrosads_operations.py | 52 ++-- .../_paging_operations_async.py | 6 +- .../paging/operations/_paging_operations.py | 2 +- .../_storage_accounts_operations_async.py | 6 +- .../_storage_accounts_operations.py | 2 +- ...ultiapi_service_client_operations_async.py | 6 +- .../_multiapi_service_client_operations.py | 2 +- .../_multiapi_service_client_operations.py | 2 +- ...ultiapi_service_client_operations_async.py | 6 +- .../_multiapi_service_client_operations.py | 2 +- 18 files changed, 333 insertions(+), 334 deletions(-) diff --git a/autorest/codegen/templates/lro_operation.py.jinja2 b/autorest/codegen/templates/lro_operation.py.jinja2 index 4b69dbee961..7a5c98b6849 100644 --- a/autorest/codegen/templates/lro_operation.py.jinja2 +++ b/autorest/codegen/templates/lro_operation.py.jinja2 @@ -5,8 +5,8 @@ {% set poller = "AsyncLROPoller" if async_mode else "LROPoller" %} {% set operation_name = "begin_"+operation.python_name %} {% macro return_docstring() %} -:return: {{ "" if async_mode else "An instance of LROPoller that returns either " }}{{ operation.responses[0].schema.docstring_text if operation.responses[0].has_body else "None"}}{{ "," if async_mode }} or the result of cls(response) -:rtype: {{"" if async_mode else "~azure.core.polling.LROPoller["}}{{ operation.responses[0].schema.docstring_type if operation.responses[0].has_body else "None" }}{{ "" if async_mode else "]" }}{% endmacro %} +:return: An instance of {{ "Async" if async_mode }}LROPoller that returns either {{ operation.responses[0].schema.docstring_text if operation.responses[0].has_body else "None"}} or the result of cls(response) +:rtype: ~azure.core.polling.{{ "Async" if async_mode }}LROPoller[{{ operation.responses[0].schema.docstring_type if operation.responses[0].has_body else "None" }}]{% endmacro %} {% macro param_documentation_string(parameter) %}:param {{ parameter.serialized_name }}: {{ parameter.description }}{% endmacro %} {% macro response_headers(response) %} response_headers = { @@ -20,11 +20,10 @@ response_headers = { {% if code_model.options['tracing'] %} {{ trace_decorator }} {% endif %} -{% set return_type_wrapper = "" if async_mode else "LROPoller" %} +{% set return_type_wrapper = "AsyncLROPoller" if async_mode else "LROPoller" %} {{ op_tools.method_signature(operation, operation_name, async_mode=async_mode, coroutine=async_mode, return_type_wrapper=return_type_wrapper) }} {%- if not async_mode %} -{# overriding sync_return_type_annotation because we know if it's sync, it's return type is just LROPoller #} - # type: (...) -> LROPoller + {{ op_tools.sync_return_type_annotation(operation, return_type_wrapper) }} {% endif %} """{{ operation.summary if operation.summary else operation.description | wordwrap(width=95, break_long_words=False, wrapstring='\n') }} {% if operation.summary and operation.description %} diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py index f733757f00e..36a2c87ed9a 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lr_os_custom_header_operations_async.py @@ -97,7 +97,7 @@ async def begin_put_async_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- @@ -111,8 +111,8 @@ async def begin_put_async_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -213,7 +213,7 @@ async def begin_put201_creating_succeeded200( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll @@ -227,8 +227,8 @@ async def begin_put201_creating_succeeded200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -319,7 +319,7 @@ async def begin_post202_retry200( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. @@ -332,8 +332,8 @@ async def begin_post202_retry200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -422,7 +422,7 @@ async def begin_post_async_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- @@ -436,8 +436,8 @@ async def begin_post_async_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py index 880f701ff66..02f33682797 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lro_retrys_operations_async.py @@ -98,7 +98,7 @@ async def begin_put201_creating_succeeded200( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -111,8 +111,8 @@ async def begin_put201_creating_succeeded200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -207,7 +207,7 @@ async def begin_put_async_relative_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- AsyncOperation header for operation status. @@ -220,8 +220,8 @@ async def begin_put_async_relative_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -314,7 +314,7 @@ async def _delete_provisioning202_accepted200_succeeded_initial( async def begin_delete_provisioning202_accepted200_succeeded( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -325,8 +325,8 @@ async def begin_delete_provisioning202_accepted200_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -409,7 +409,7 @@ async def _delete202_retry200_initial( async def begin_delete202_retry200( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -419,8 +419,8 @@ async def begin_delete202_retry200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -497,7 +497,7 @@ async def _delete_async_relative_retry_succeeded_initial( async def begin_delete_async_relative_retry_succeeded( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -507,8 +507,8 @@ async def begin_delete_async_relative_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -595,7 +595,7 @@ async def begin_post202_retry200( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. @@ -607,8 +607,8 @@ async def begin_post202_retry200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -697,7 +697,7 @@ async def begin_post_async_relative_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- AsyncOperation header for operation status. @@ -710,8 +710,8 @@ async def begin_post_async_relative_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py index 37ca98390ab..2186491c006 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lros_operations_async.py @@ -95,7 +95,7 @@ async def begin_put200_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. @@ -107,8 +107,8 @@ async def begin_put200_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -199,7 +199,7 @@ async def begin_put201_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. @@ -211,8 +211,8 @@ async def begin_put201_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -299,7 +299,7 @@ async def _post202_list_initial( async def begin_post202_list( self, **kwargs - ) -> List["models.Product"]: + ) -> AsyncLROPoller[List["models.Product"]]: """Long running put request, service returns a 202 with empty body to first request, returns a 200 with body [{ 'id': '100', 'name': 'foo' }]. @@ -309,8 +309,8 @@ async def begin_post202_list( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: list of Product, or the result of cls(response) - :rtype: list[~lro.models.Product] + :return: An instance of AsyncLROPoller that returns either list of Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[list[~lro.models.Product]] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -400,7 +400,7 @@ async def begin_put200_succeeded_no_state( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. @@ -412,8 +412,8 @@ async def begin_put200_succeeded_no_state( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -504,7 +504,7 @@ async def begin_put202_retry200( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. @@ -517,8 +517,8 @@ async def begin_put202_retry200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -614,7 +614,7 @@ async def begin_put201_creating_succeeded200( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -627,8 +627,8 @@ async def begin_put201_creating_succeeded200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -719,7 +719,7 @@ async def begin_put200_updating_succeeded204( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -732,8 +732,8 @@ async def begin_put200_updating_succeeded204( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -829,7 +829,7 @@ async def begin_put201_creating_failed200( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. @@ -842,8 +842,8 @@ async def begin_put201_creating_failed200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -934,7 +934,7 @@ async def begin_put200_acceptedcanceled200( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. @@ -947,8 +947,8 @@ async def begin_put200_acceptedcanceled200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1041,7 +1041,7 @@ async def begin_put_no_header_in_retry( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. @@ -1053,8 +1053,8 @@ async def begin_put_no_header_in_retry( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1152,7 +1152,7 @@ async def begin_put_async_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1165,8 +1165,8 @@ async def begin_put_async_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1265,7 +1265,7 @@ async def begin_put_async_no_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1278,8 +1278,8 @@ async def begin_put_async_no_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1378,7 +1378,7 @@ async def begin_put_async_retry_failed( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1391,8 +1391,8 @@ async def begin_put_async_retry_failed( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1491,7 +1491,7 @@ async def begin_put_async_no_retrycanceled( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1504,8 +1504,8 @@ async def begin_put_async_no_retrycanceled( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1602,7 +1602,7 @@ async def begin_put_async_no_header_in_retry( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 202 to the initial request with Azure- AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. @@ -1615,8 +1615,8 @@ async def begin_put_async_no_header_in_retry( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1710,7 +1710,7 @@ async def begin_put_non_resource( self, sku: Optional["models.Sku"] = None, **kwargs - ) -> "models.Sku": + ) -> AsyncLROPoller["models.Sku"]: """Long running put request with non resource. :param sku: sku to put. @@ -1721,8 +1721,8 @@ async def begin_put_non_resource( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Sku, or the result of cls(response) - :rtype: ~lro.models.Sku + :return: An instance of AsyncLROPoller that returns either Sku or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Sku] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1813,7 +1813,7 @@ async def begin_put_async_non_resource( self, sku: Optional["models.Sku"] = None, **kwargs - ) -> "models.Sku": + ) -> AsyncLROPoller["models.Sku"]: """Long running put request with non resource. :param sku: Sku to put. @@ -1824,8 +1824,8 @@ async def begin_put_async_non_resource( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Sku, or the result of cls(response) - :rtype: ~lro.models.Sku + :return: An instance of AsyncLROPoller that returns either Sku or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Sku] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1918,7 +1918,7 @@ async def begin_put_sub_resource( self, provisioning_state: Optional[str] = None, **kwargs - ) -> "models.SubProduct": + ) -> AsyncLROPoller["models.SubProduct"]: """Long running put request with sub resource. :param provisioning_state: @@ -1929,8 +1929,8 @@ async def begin_put_sub_resource( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: SubProduct, or the result of cls(response) - :rtype: ~lro.models.SubProduct + :return: An instance of AsyncLROPoller that returns either SubProduct or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.SubProduct] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2023,7 +2023,7 @@ async def begin_put_async_sub_resource( self, provisioning_state: Optional[str] = None, **kwargs - ) -> "models.SubProduct": + ) -> AsyncLROPoller["models.SubProduct"]: """Long running put request with sub resource. :param provisioning_state: @@ -2034,8 +2034,8 @@ async def begin_put_async_sub_resource( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: SubProduct, or the result of cls(response) - :rtype: ~lro.models.SubProduct + :return: An instance of AsyncLROPoller that returns either SubProduct or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.SubProduct] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2123,7 +2123,7 @@ async def _delete_provisioning202_accepted200_succeeded_initial( async def begin_delete_provisioning202_accepted200_succeeded( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2134,8 +2134,8 @@ async def begin_delete_provisioning202_accepted200_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2226,7 +2226,7 @@ async def _delete_provisioning202_deleting_failed200_initial( async def begin_delete_provisioning202_deleting_failed200( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. @@ -2237,8 +2237,8 @@ async def begin_delete_provisioning202_deleting_failed200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2329,7 +2329,7 @@ async def _delete_provisioning202_deletingcanceled200_initial( async def begin_delete_provisioning202_deletingcanceled200( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. @@ -2340,8 +2340,8 @@ async def begin_delete_provisioning202_deletingcanceled200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2420,7 +2420,7 @@ async def _delete204_succeeded_initial( async def begin_delete204_succeeded( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete succeeds and returns right away. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2429,8 +2429,8 @@ async def begin_delete204_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2513,7 +2513,7 @@ async def _delete202_retry200_initial( async def begin_delete202_retry200( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2523,8 +2523,8 @@ async def begin_delete202_retry200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2610,7 +2610,7 @@ async def _delete202_no_retry204_initial( async def begin_delete202_no_retry204( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2620,8 +2620,8 @@ async def begin_delete202_no_retry204( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2700,7 +2700,7 @@ async def _delete_no_header_in_retry_initial( async def begin_delete_no_header_in_retry( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. @@ -2710,8 +2710,8 @@ async def begin_delete_no_header_in_retry( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2787,7 +2787,7 @@ async def _delete_async_no_header_in_retry_initial( async def begin_delete_async_no_header_in_retry( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. @@ -2797,8 +2797,8 @@ async def begin_delete_async_no_header_in_retry( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2875,7 +2875,7 @@ async def _delete_async_retry_succeeded_initial( async def begin_delete_async_retry_succeeded( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2885,8 +2885,8 @@ async def begin_delete_async_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2963,7 +2963,7 @@ async def _delete_async_no_retry_succeeded_initial( async def begin_delete_async_no_retry_succeeded( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2973,8 +2973,8 @@ async def begin_delete_async_no_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3051,7 +3051,7 @@ async def _delete_async_retry_failed_initial( async def begin_delete_async_retry_failed( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3061,8 +3061,8 @@ async def begin_delete_async_retry_failed( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3139,7 +3139,7 @@ async def _delete_async_retrycanceled_initial( async def begin_delete_async_retrycanceled( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3149,8 +3149,8 @@ async def begin_delete_async_retrycanceled( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3231,7 +3231,7 @@ async def _post200_with_payload_initial( async def begin_post200_with_payload( self, **kwargs - ) -> "models.Sku": + ) -> AsyncLROPoller["models.Sku"]: """Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. @@ -3241,8 +3241,8 @@ async def begin_post200_with_payload( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Sku, or the result of cls(response) - :rtype: ~lro.models.Sku + :return: An instance of AsyncLROPoller that returns either Sku or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Sku] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3332,7 +3332,7 @@ async def begin_post202_retry200( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. @@ -3344,8 +3344,8 @@ async def begin_post202_retry200( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3436,7 +3436,7 @@ async def begin_post202_no_retry204( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. @@ -3448,8 +3448,8 @@ async def begin_post202_no_retry204( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3533,7 +3533,7 @@ async def _post_double_headers_final_location_get_initial( async def begin_post_double_headers_final_location_get( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should poll Location to get the final object. @@ -3544,8 +3544,8 @@ async def begin_post_double_headers_final_location_get( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3624,7 +3624,7 @@ async def _post_double_headers_final_azure_header_get_initial( async def begin_post_double_headers_final_azure_header_get( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object. @@ -3635,8 +3635,8 @@ async def begin_post_double_headers_final_azure_header_get( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3715,7 +3715,7 @@ async def _post_double_headers_final_azure_header_get_default_initial( async def begin_post_double_headers_final_azure_header_get_default( self, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object if you support initial Autorest behavior. @@ -3726,8 +3726,8 @@ async def begin_post_double_headers_final_azure_header_get_default( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3825,7 +3825,7 @@ async def begin_post_async_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3838,8 +3838,8 @@ async def begin_post_async_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -3938,7 +3938,7 @@ async def begin_post_async_no_retry_succeeded( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3951,8 +3951,8 @@ async def begin_post_async_no_retry_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -4044,7 +4044,7 @@ async def begin_post_async_retry_failed( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -4057,8 +4057,8 @@ async def begin_post_async_retry_failed( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -4147,7 +4147,7 @@ async def begin_post_async_retrycanceled( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -4160,8 +4160,8 @@ async def begin_post_async_retrycanceled( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py index 3533a151ed1..364e800e44b 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/aio/operations_async/_lrosads_operations_async.py @@ -98,7 +98,7 @@ async def begin_put_non_retry400( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 400 to the initial request. :param product: Product to put. @@ -109,8 +109,8 @@ async def begin_put_non_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -206,7 +206,7 @@ async def begin_put_non_retry201_creating400( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. @@ -218,8 +218,8 @@ async def begin_put_non_retry201_creating400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -315,7 +315,7 @@ async def begin_put_non_retry201_creating400_invalid_json( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. @@ -327,8 +327,8 @@ async def begin_put_non_retry201_creating400_invalid_json( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -423,7 +423,7 @@ async def begin_put_async_relative_retry400( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -435,8 +435,8 @@ async def begin_put_async_relative_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -521,7 +521,7 @@ async def _delete_non_retry400_initial( async def begin_delete_non_retry400( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 400 with an error body. :keyword callable cls: A custom type or function that will be passed the direct response @@ -530,8 +530,8 @@ async def begin_delete_non_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -607,7 +607,7 @@ async def _delete202_non_retry400_initial( async def begin_delete202_non_retry400( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 with a location header. :keyword callable cls: A custom type or function that will be passed the direct response @@ -616,8 +616,8 @@ async def begin_delete202_non_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -694,7 +694,7 @@ async def _delete_async_relative_retry400_initial( async def begin_delete_async_relative_retry400( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -704,8 +704,8 @@ async def begin_delete_async_relative_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -792,7 +792,7 @@ async def begin_post_non_retry400( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 400 with no error body. :param product: Product to put. @@ -803,8 +803,8 @@ async def begin_post_non_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -892,7 +892,7 @@ async def begin_post202_non_retry400( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 with a location header. :param product: Product to put. @@ -903,8 +903,8 @@ async def begin_post202_non_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -993,7 +993,7 @@ async def begin_post_async_relative_retry400( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1005,8 +1005,8 @@ async def begin_post_async_relative_retry400( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1099,7 +1099,7 @@ async def begin_put_error201_no_provisioning_state_payload( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 201 to the initial request with no payload. :param product: Product to put. @@ -1110,8 +1110,8 @@ async def begin_put_error201_no_provisioning_state_payload( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1206,7 +1206,7 @@ async def begin_put_async_relative_retry_no_status( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1219,8 +1219,8 @@ async def begin_put_async_relative_retry_no_status( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1320,7 +1320,7 @@ async def begin_put_async_relative_retry_no_status_payload( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1333,8 +1333,8 @@ async def begin_put_async_relative_retry_no_status_payload( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1415,7 +1415,7 @@ async def _delete204_succeeded_initial( async def begin_delete204_succeeded( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 204 to the initial request, indicating success. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1424,8 +1424,8 @@ async def begin_delete204_succeeded( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1502,7 +1502,7 @@ async def _delete_async_relative_retry_no_status_initial( async def begin_delete_async_relative_retry_no_status( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1512,8 +1512,8 @@ async def begin_delete_async_relative_retry_no_status( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1600,7 +1600,7 @@ async def begin_post202_no_location( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, without a location header. @@ -1612,8 +1612,8 @@ async def begin_post202_no_location( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1702,7 +1702,7 @@ async def begin_post_async_relative_retry_no_payload( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1715,8 +1715,8 @@ async def begin_post_async_relative_retry_no_payload( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1806,7 +1806,7 @@ async def begin_put200_invalid_json( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. @@ -1818,8 +1818,8 @@ async def begin_put200_invalid_json( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -1914,7 +1914,7 @@ async def begin_put_async_relative_retry_invalid_header( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. @@ -1927,8 +1927,8 @@ async def begin_put_async_relative_retry_invalid_header( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2028,7 +2028,7 @@ async def begin_put_async_relative_retry_invalid_json_polling( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2041,8 +2041,8 @@ async def begin_put_async_relative_retry_invalid_json_polling( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~lro.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~lro.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2127,7 +2127,7 @@ async def _delete202_retry_invalid_header_initial( async def begin_delete202_retry_invalid_header( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. @@ -2137,8 +2137,8 @@ async def begin_delete202_retry_invalid_header( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2215,7 +2215,7 @@ async def _delete_async_relative_retry_invalid_header_initial( async def begin_delete_async_relative_retry_invalid_header( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. @@ -2225,8 +2225,8 @@ async def begin_delete_async_relative_retry_invalid_header( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2303,7 +2303,7 @@ async def _delete_async_relative_retry_invalid_json_polling_initial( async def begin_delete_async_relative_retry_invalid_json_polling( self, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2313,8 +2313,8 @@ async def begin_delete_async_relative_retry_invalid_json_polling( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2401,7 +2401,7 @@ async def begin_post202_retry_invalid_header( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. @@ -2413,8 +2413,8 @@ async def begin_post202_retry_invalid_header( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2503,7 +2503,7 @@ async def begin_post_async_relative_retry_invalid_header( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. @@ -2516,8 +2516,8 @@ async def begin_post_async_relative_retry_invalid_header( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -2606,7 +2606,7 @@ async def begin_post_async_relative_retry_invalid_json_polling( self, product: Optional["models.Product"] = None, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2619,8 +2619,8 @@ async def begin_post_async_relative_retry_invalid_json_polling( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py index 4fbd3ed5f9b..3b42c68efde 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lr_os_custom_header_operations.py @@ -103,7 +103,7 @@ def begin_put_async_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- @@ -221,7 +221,7 @@ def begin_put201_creating_succeeded200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll @@ -329,7 +329,7 @@ def begin_post202_retry200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. @@ -434,7 +434,7 @@ def begin_post_async_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py index 005103e8602..c574ba82e58 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lro_retrys_operations.py @@ -104,7 +104,7 @@ def begin_put201_creating_succeeded200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -215,7 +215,7 @@ def begin_put_async_relative_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- AsyncOperation header for operation status. @@ -324,7 +324,7 @@ def begin_delete_provisioning202_accepted200_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -421,7 +421,7 @@ def begin_delete202_retry200( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -511,7 +511,7 @@ def begin_delete_async_relative_retry_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -611,7 +611,7 @@ def begin_post202_retry200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. @@ -715,7 +715,7 @@ def begin_post_async_relative_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure- AsyncOperation header for operation status. diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py index 431fbba40b6..a9e3f60120d 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lros_operations.py @@ -101,7 +101,7 @@ def begin_put200_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. @@ -207,7 +207,7 @@ def begin_put201_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. @@ -309,7 +309,7 @@ def begin_post202_list( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[List["models.Product"]] """Long running put request, service returns a 202 with empty body to first request, returns a 200 with body [{ 'id': '100', 'name': 'foo' }]. @@ -412,7 +412,7 @@ def begin_put200_succeeded_no_state( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. @@ -518,7 +518,7 @@ def begin_put202_retry200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. @@ -630,7 +630,7 @@ def begin_put201_creating_succeeded200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -737,7 +737,7 @@ def begin_put200_updating_succeeded204( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -849,7 +849,7 @@ def begin_put201_creating_failed200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. @@ -956,7 +956,7 @@ def begin_put200_acceptedcanceled200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. @@ -1065,7 +1065,7 @@ def begin_put_no_header_in_retry( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. @@ -1178,7 +1178,7 @@ def begin_put_async_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1293,7 +1293,7 @@ def begin_put_async_no_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1408,7 +1408,7 @@ def begin_put_async_retry_failed( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1523,7 +1523,7 @@ def begin_put_async_no_retrycanceled( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1636,7 +1636,7 @@ def begin_put_async_no_header_in_retry( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 202 to the initial request with Azure- AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. @@ -1746,7 +1746,7 @@ def begin_put_non_resource( sku=None, # type: Optional["models.Sku"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Sku"] """Long running put request with non resource. :param sku: sku to put. @@ -1851,7 +1851,7 @@ def begin_put_async_non_resource( sku=None, # type: Optional["models.Sku"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Sku"] """Long running put request with non resource. :param sku: Sku to put. @@ -1958,7 +1958,7 @@ def begin_put_sub_resource( provisioning_state=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.SubProduct"] """Long running put request with sub resource. :param provisioning_state: @@ -2065,7 +2065,7 @@ def begin_put_async_sub_resource( provisioning_state=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.SubProduct"] """Long running put request with sub resource. :param provisioning_state: @@ -2167,7 +2167,7 @@ def begin_delete_provisioning202_accepted200_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2272,7 +2272,7 @@ def begin_delete_provisioning202_deleting_failed200( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. @@ -2377,7 +2377,7 @@ def begin_delete_provisioning202_deletingcanceled200( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. @@ -2470,7 +2470,7 @@ def begin_delete204_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete succeeds and returns right away. :keyword callable cls: A custom type or function that will be passed the direct response @@ -2565,7 +2565,7 @@ def begin_delete202_retry200( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2664,7 +2664,7 @@ def begin_delete202_no_retry204( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. @@ -2756,7 +2756,7 @@ def begin_delete_no_header_in_retry( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. @@ -2845,7 +2845,7 @@ def begin_delete_async_no_header_in_retry( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. @@ -2935,7 +2935,7 @@ def begin_delete_async_retry_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3025,7 +3025,7 @@ def begin_delete_async_no_retry_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3115,7 +3115,7 @@ def begin_delete_async_retry_failed( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3205,7 +3205,7 @@ def begin_delete_async_retrycanceled( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -3299,7 +3299,7 @@ def begin_post200_with_payload( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Sku"] """Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. @@ -3402,7 +3402,7 @@ def begin_post202_retry200( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. @@ -3508,7 +3508,7 @@ def begin_post202_no_retry204( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. @@ -3607,7 +3607,7 @@ def begin_post_double_headers_final_location_get( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should poll Location to get the final object. @@ -3700,7 +3700,7 @@ def begin_post_double_headers_final_azure_header_get( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object. @@ -3793,7 +3793,7 @@ def begin_post_double_headers_final_azure_header_get_default( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object if you support initial Autorest behavior. @@ -3905,7 +3905,7 @@ def begin_post_async_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -4020,7 +4020,7 @@ def begin_post_async_no_retry_succeeded( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -4128,7 +4128,7 @@ def begin_post_async_retry_failed( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -4233,7 +4233,7 @@ def begin_post_async_retrycanceled( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. diff --git a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py index 6018f3a552d..022da243859 100644 --- a/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py +++ b/test/azure/Expected/AcceptanceTests/Lro/lro/operations/_lrosads_operations.py @@ -104,7 +104,7 @@ def begin_put_non_retry400( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 400 to the initial request. :param product: Product to put. @@ -214,7 +214,7 @@ def begin_put_non_retry201_creating400( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. @@ -325,7 +325,7 @@ def begin_put_non_retry201_creating400_invalid_json( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. @@ -435,7 +435,7 @@ def begin_put_async_relative_retry400( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -535,7 +535,7 @@ def begin_delete_non_retry400( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 400 with an error body. :keyword callable cls: A custom type or function that will be passed the direct response @@ -623,7 +623,7 @@ def begin_delete202_non_retry400( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 with a location header. :keyword callable cls: A custom type or function that will be passed the direct response @@ -712,7 +712,7 @@ def begin_delete_async_relative_retry400( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -812,7 +812,7 @@ def begin_post_non_retry400( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 400 with no error body. :param product: Product to put. @@ -914,7 +914,7 @@ def begin_post202_non_retry400( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 with a location header. :param product: Product to put. @@ -1017,7 +1017,7 @@ def begin_post_async_relative_retry400( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1125,7 +1125,7 @@ def begin_put_error201_no_provisioning_state_payload( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 201 to the initial request with no payload. :param product: Product to put. @@ -1234,7 +1234,7 @@ def begin_put_async_relative_retry_no_status( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1350,7 +1350,7 @@ def begin_put_async_relative_retry_no_status_payload( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1447,7 +1447,7 @@ def begin_delete204_succeeded( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 204 to the initial request, indicating success. :keyword callable cls: A custom type or function that will be passed the direct response @@ -1536,7 +1536,7 @@ def begin_delete_async_relative_retry_no_status( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1636,7 +1636,7 @@ def begin_post202_no_location( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, without a location header. @@ -1740,7 +1740,7 @@ def begin_post_async_relative_retry_no_payload( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -1846,7 +1846,7 @@ def begin_put200_invalid_json( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. @@ -1956,7 +1956,7 @@ def begin_put_async_relative_retry_invalid_header( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. @@ -2072,7 +2072,7 @@ def begin_put_async_relative_retry_invalid_json_polling( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2173,7 +2173,7 @@ def begin_delete202_retry_invalid_header( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. @@ -2263,7 +2263,7 @@ def begin_delete_async_relative_retry_invalid_header( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. @@ -2353,7 +2353,7 @@ def begin_delete_async_relative_retry_invalid_json_polling( self, **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. @@ -2453,7 +2453,7 @@ def begin_post202_retry_invalid_header( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. @@ -2557,7 +2557,7 @@ def begin_post_async_relative_retry_invalid_header( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. @@ -2662,7 +2662,7 @@ def begin_post_async_relative_retry_invalid_json_polling( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. diff --git a/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py b/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py index f47473c0fa0..b1810244c5d 100644 --- a/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py @@ -1026,7 +1026,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 - ) -> "models.ProductResult": + ) -> AsyncLROPoller["models.ProductResult"]: """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: @@ -1039,8 +1039,8 @@ async def begin_get_multiple_pages_lro( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: ProductResult, or the result of cls(response) - :rtype: ~paging.models.ProductResult + :return: An instance of AsyncLROPoller that returns either ProductResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~paging.models.ProductResult] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py b/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py index 86638a4ff27..dd9e42f1111 100644 --- a/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py +++ b/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py @@ -1045,7 +1045,7 @@ def begin_get_multiple_pages_lro( paging_get_multiple_pages_lro_options=None, # type: Optional["models.PagingGetMultiplePagesLroOptions"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ProductResult"] """A long-running paging operation that includes a nextLink that has 10 pages. :param client_request_id: diff --git a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations_async/_storage_accounts_operations_async.py b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations_async/_storage_accounts_operations_async.py index 96f2c036621..5fa3b106a73 100644 --- a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations_async/_storage_accounts_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/aio/operations_async/_storage_accounts_operations_async.py @@ -166,7 +166,7 @@ async def begin_create( account_name: str, parameters: "models.StorageAccountCreateParameters", **kwargs - ) -> "models.StorageAccount": + ) -> AsyncLROPoller["models.StorageAccount"]: """Asynchronously creates a new storage account with the specified parameters. Existing accounts cannot be updated with this API and should instead use the Update Storage Account API. If an account is already created and subsequent PUT request is issued with exact same set of @@ -186,8 +186,8 @@ async def begin_create( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: StorageAccount, or the result of cls(response) - :rtype: ~storage.models.StorageAccount + :return: An instance of AsyncLROPoller that returns either StorageAccount or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~storage.models.StorageAccount] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] diff --git a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py index 1b90aa5b9ef..a858f306771 100644 --- a/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py +++ b/test/azure/Expected/AcceptanceTests/StorageManagementClient/storage/operations/_storage_accounts_operations.py @@ -172,7 +172,7 @@ def begin_create( parameters, # type: "models.StorageAccountCreateParameters" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.StorageAccount"] """Asynchronously creates a new storage account with the specified parameters. Existing accounts cannot be updated with this API and should instead use the Update Storage Account API. If an account is already created and subsequent PUT request is issued with exact same set of diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations_async/_multiapi_service_client_operations_async.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations_async/_multiapi_service_client_operations_async.py index 8f44bc04f80..cf974a74994 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations_async/_multiapi_service_client_operations_async.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/aio/operations_async/_multiapi_service_client_operations_async.py @@ -123,7 +123,7 @@ async def begin_test_lro( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -134,8 +134,8 @@ async def begin_test_lro( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~multiapi.v1.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~multiapi.v1.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py index 4485e7eadb0..d2b493f502b 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/operations/_multiapi_service_client_operations.py @@ -130,7 +130,7 @@ def begin_test_lro( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py index a78c42fb10d..b14ec738268 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/operations/_multiapi_service_client_operations.py @@ -130,7 +130,7 @@ def begin_test_lro( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations_async/_multiapi_service_client_operations_async.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations_async/_multiapi_service_client_operations_async.py index b729f2581f9..a0e22fc7e70 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations_async/_multiapi_service_client_operations_async.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/aio/operations_async/_multiapi_service_client_operations_async.py @@ -123,7 +123,7 @@ async def begin_test_lro( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -134,8 +134,8 @@ async def begin_test_lro( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: Product, or the result of cls(response) - :rtype: ~multiapiwithsubmodule.submodule.v1.models.Product + :return: An instance of AsyncLROPoller that returns either Product or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~multiapiwithsubmodule.submodule.v1.models.Product] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py index b6573ec26f5..b474c944d01 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/operations/_multiapi_service_client_operations.py @@ -130,7 +130,7 @@ def begin_test_lro( product=None, # type: Optional["models.Product"] **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.Product"] """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. From 6ad0b77df3731038933a8a07551818240123a19d Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Tue, 26 May 2020 20:16:27 -0400 Subject: [PATCH 21/26] LRO handling in multiapi with async LROPoller (#649) * fixed async docs and typing * added return type to LROPoller sync typing * fixed handling of LRO in multiapi * fixed return type for async functions --- autorest/codegen/templates/metadata.json.jinja2 | 12 +++++------- autorest/multiapi/__init__.py | 6 ++---- .../templates/multiapi_operations_mixin.py.jinja2 | 6 +++--- .../AcceptanceTests/asynctests/multiapi_base.py | 3 ++- .../multiapi/aio/_multiapi_service_client_async.py | 2 +- .../Multiapi/multiapi/aio/_operations_mixin_async.py | 8 ++++---- .../Multiapi/multiapi/v1/_metadata.json | 10 ++-------- .../Multiapi/multiapi/v2/_metadata.json | 2 -- .../Multiapi/multiapi/v3/_metadata.json | 2 -- .../multiapinoasync/v1/_metadata.json | 10 ++-------- .../multiapinoasync/v2/_metadata.json | 2 -- .../multiapinoasync/v3/_metadata.json | 2 -- .../submodule/aio/_multiapi_service_client_async.py | 2 +- .../submodule/aio/_operations_mixin_async.py | 8 ++++---- .../submodule/v1/_metadata.json | 10 ++-------- .../submodule/v2/_metadata.json | 2 -- .../submodule/v3/_metadata.json | 2 -- 17 files changed, 28 insertions(+), 61 deletions(-) diff --git a/autorest/codegen/templates/metadata.json.jinja2 b/autorest/codegen/templates/metadata.json.jinja2 index f682bc60268..11f8da77585 100644 --- a/autorest/codegen/templates/metadata.json.jinja2 +++ b/autorest/codegen/templates/metadata.json.jinja2 @@ -50,18 +50,16 @@ }, "operation_mixins": { {% for operation in mixin_operations %} - {{ operation.name | tojson }} : { + {% set operation_name = "begin_" + operation.name if is_lro(operation) else operation.name %} + {{ operation_name | tojson }} : { "sync": { - {% set sync_operation_name = "begin_" + operation.name if is_lro(operation) else operation.name %} {% set sync_return_type_wrapper = "LROPoller" if is_lro(operation) else ("ItemPaged" if is_paging(operation) else "") %} - "operation_name": {{ sync_operation_name | tojson }}, - "signature": {{ op_tools.method_signature(operation, sync_operation_name, False, False, sync_return_type_wrapper) | tojson }} + "signature": {{ op_tools.method_signature(operation, operation_name, False, False, sync_return_type_wrapper) | tojson }} }, "async": { {% set coroutine = False if is_paging(operation) else True %} - {% set async_return_type_wrapper = "AsyncItemPaged" if is_paging(operation) else "" %} - "operation_name": {{ operation.name | tojson }}, - "signature": {{ op_tools.method_signature(operation, operation.name, True, coroutine, async_return_type_wrapper) | tojson }}, + {% set async_return_type_wrapper = "AsyncLROPoller" if is_lro(operation) else ("AsyncItemPaged" if is_paging(operation) else "") %} + "signature": {{ op_tools.method_signature(operation, operation_name, True, coroutine, async_return_type_wrapper) | tojson }}, "coroutine": {{ coroutine | tojson }} }, "doc": {{ op_tools.operation_docstring(operation) | tojson }}, diff --git a/autorest/multiapi/__init__.py b/autorest/multiapi/__init__.py index 3b0e5fe2014..07a7ae64b18 100644 --- a/autorest/multiapi/__init__.py +++ b/autorest/multiapi/__init__.py @@ -103,8 +103,8 @@ def there_is_a_rt_that_contains_api_version(rt_dict, api_version): # Operations at client level versioned_dict.update( { - operation_metadata[sync_or_async]["operation_name"]: operation_metadata[sync_or_async]["available_apis"] - for operation_metadata in mixin_operations.values() + operation_name: operation_metadata[sync_or_async]["available_apis"] + for operation_name, operation_metadata in mixin_operations.items() } ) for operation, api_versions_list in versioned_dict.items(): @@ -181,13 +181,11 @@ def _build_operation_mixin_meta(self, paths_to_versions: List[Path]) -> Dict[str mixin_operations.setdefault(func_name, {}).setdefault('async', {}) mixin_operations[func_name]['sync'].update({ "signature": func['sync']['signature'], - "operation_name": func['sync']['operation_name'], "doc": func['doc'], "call": func['call'] }) mixin_operations[func_name]['async'].update({ "signature": func['async']['signature'], - "operation_name": func['async']['operation_name'], "coroutine": func['async']['coroutine'], "doc": func['doc'], "call": func['call'] diff --git a/autorest/multiapi/templates/multiapi_operations_mixin.py.jinja2 b/autorest/multiapi/templates/multiapi_operations_mixin.py.jinja2 index cf50ce67016..2c7e500697c 100644 --- a/autorest/multiapi/templates/multiapi_operations_mixin.py.jinja2 +++ b/autorest/multiapi/templates/multiapi_operations_mixin.py.jinja2 @@ -16,11 +16,11 @@ from msrest import Serializer, Deserializer class {{ client_name }}OperationsMixin(object): -{% for _, metadata_sync_and_async in mixin_operations|dictsort %} +{% for operation_name, metadata_sync_and_async in mixin_operations|dictsort %} {% set metadata = metadata_sync_and_async['async'] if async_mode else metadata_sync_and_async['sync'] %} {{ metadata['signature'] | indent }} {{ metadata['doc'] | indent(8) }} - api_version = self._get_api_version('{{ metadata['operation_name'] }}') + api_version = self._get_api_version('{{ operation_name }}') {% for api in metadata['available_apis']|sort %} {% set if_statement = "if" if loop.first else "elif" %} {{ if_statement }} api_version == '{{ mod_to_api_version[api] }}': @@ -33,5 +33,5 @@ class {{ client_name }}OperationsMixin(object): mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return {{ "await " if async_mode and metadata['coroutine'] else "" }}mixin_instance.{{ metadata['operation_name'] }}({{ metadata['call'] }}{{ ", **kwargs" if metadata['call'] else "**kwargs" }}) + return {{ "await " if async_mode and metadata['coroutine'] else "" }}mixin_instance.{{ operation_name }}({{ metadata['call'] }}{{ ", **kwargs" if metadata['call'] else "**kwargs" }}) {% endfor %} \ No newline at end of file diff --git a/test/multiapi/AcceptanceTests/asynctests/multiapi_base.py b/test/multiapi/AcceptanceTests/asynctests/multiapi_base.py index 249ca0ae36b..23fec594ef0 100644 --- a/test/multiapi/AcceptanceTests/asynctests/multiapi_base.py +++ b/test/multiapi/AcceptanceTests/asynctests/multiapi_base.py @@ -181,7 +181,8 @@ async def test_version_two_operation_group_two(self, client): @pytest.mark.parametrize('api_version', ["1.0.0"]) @pytest.mark.asyncio async def test_lro(self, client, namespace_models): - product = await client.test_lro(namespace_models.Product()) + poller = await client.begin_test_lro(namespace_models.Product()) + product = await poller.result() assert product.id == 100 @pytest.mark.asyncio diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_multiapi_service_client_async.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_multiapi_service_client_async.py index fec9d8babb4..dfa13e5b3c0 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_multiapi_service_client_async.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_multiapi_service_client_async.py @@ -49,7 +49,7 @@ class MultiapiServiceClient(MultiapiServiceClientOperationsMixin, MultiApiClient LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, - 'test_lro': '1.0.0', + 'begin_test_lro': '1.0.0', 'test_one': '2.0.0', }}, _PROFILE_TAG + " latest" diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin_async.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin_async.py index 2643b77915a..a4af9a328a8 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin_async.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin_async.py @@ -20,11 +20,11 @@ class MultiapiServiceClientOperationsMixin(object): - async def test_lro( + async def begin_test_lro( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -34,7 +34,7 @@ async def test_lro( :rtype: ~multiapi.v1.models.Product or None :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('test_lro') + api_version = self._get_api_version('begin_test_lro') if api_version == '1.0.0': from ..v1.aio.operations_async import MultiapiServiceClientOperationsMixin as OperationClass else: @@ -44,7 +44,7 @@ async def test_lro( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.test_lro(product, **kwargs) + return await mixin_instance.begin_test_lro(product, **kwargs) async def test_one( self, diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json index 5ae7064e457..0082bc1ecd8 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json @@ -37,11 +37,9 @@ "operation_mixins": { "test_one" : { "sync": { - "operation_name": "test_one", "signature": "def test_one(\n self,\n id, # type: int\n message=None, # type: Optional[str]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "test_one", "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e None:\n", "coroutine": true }, @@ -50,25 +48,21 @@ }, "_test_lro_initial" : { "sync": { - "operation_name": "_test_lro_initial", "signature": "def _test_lro_initial(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "_test_lro_initial", "signature": "async def _test_lro_initial(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e \"models.Product\":\n", "coroutine": true }, "doc": " \"\"\"\n\n:param product: Product to put.\n:type product: ~multiapi.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapi.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"", "call": "product" }, - "test_lro" : { + "begin_test_lro" : { "sync": { - "operation_name": "begin_test_lro", "signature": "def begin_test_lro(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "test_lro", - "signature": "async def test_lro(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e \"models.Product\":\n", + "signature": "async def begin_test_lro(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[\"models.Product\"]:\n", "coroutine": true }, "doc": " \"\"\"Put in whatever shape of Product you want, will return a Product with id equal to 100.\n\n:param product: Product to put.\n:type product: ~multiapi.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapi.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"", diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/_metadata.json b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/_metadata.json index 7f4d71d3487..bcfd8aaf876 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/_metadata.json @@ -38,11 +38,9 @@ "operation_mixins": { "test_one" : { "sync": { - "operation_name": "test_one", "signature": "def test_one(\n self,\n id, # type: int\n message=None, # type: Optional[str]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "test_one", "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e \"models.ModelTwo\":\n", "coroutine": true }, diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json index ce561fbf18f..5953fe8f741 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json @@ -38,11 +38,9 @@ "operation_mixins": { "test_paging" : { "sync": { - "operation_name": "test_paging", "signature": "def test_paging(\n self,\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "test_paging", "signature": "def test_paging(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.PagingResult\"]:\n", "coroutine": false }, diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json index 4af2a4e2659..b47ebb898b9 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json @@ -37,11 +37,9 @@ "operation_mixins": { "test_one" : { "sync": { - "operation_name": "test_one", "signature": "def test_one(\n self,\n id, # type: int\n message=None, # type: Optional[str]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "test_one", "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e None:\n", "coroutine": true }, @@ -50,25 +48,21 @@ }, "_test_lro_initial" : { "sync": { - "operation_name": "_test_lro_initial", "signature": "def _test_lro_initial(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "_test_lro_initial", "signature": "async def _test_lro_initial(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e \"models.Product\":\n", "coroutine": true }, "doc": " \"\"\"\n\n:param product: Product to put.\n:type product: ~multiapinoasync.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapinoasync.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"", "call": "product" }, - "test_lro" : { + "begin_test_lro" : { "sync": { - "operation_name": "begin_test_lro", "signature": "def begin_test_lro(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "test_lro", - "signature": "async def test_lro(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e \"models.Product\":\n", + "signature": "async def begin_test_lro(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[\"models.Product\"]:\n", "coroutine": true }, "doc": " \"\"\"Put in whatever shape of Product you want, will return a Product with id equal to 100.\n\n:param product: Product to put.\n:type product: ~multiapinoasync.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapinoasync.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"", diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/_metadata.json index b981a3ced91..0323f54a015 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/_metadata.json @@ -38,11 +38,9 @@ "operation_mixins": { "test_one" : { "sync": { - "operation_name": "test_one", "signature": "def test_one(\n self,\n id, # type: int\n message=None, # type: Optional[str]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "test_one", "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e \"models.ModelTwo\":\n", "coroutine": true }, diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json index e0b2353be92..40e1a20d0fa 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json @@ -38,11 +38,9 @@ "operation_mixins": { "test_paging" : { "sync": { - "operation_name": "test_paging", "signature": "def test_paging(\n self,\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "test_paging", "signature": "def test_paging(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.PagingResult\"]:\n", "coroutine": false }, diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_multiapi_service_client_async.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_multiapi_service_client_async.py index c8d71d4fcfe..ce5870e503a 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_multiapi_service_client_async.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_multiapi_service_client_async.py @@ -49,7 +49,7 @@ class MultiapiServiceClient(MultiapiServiceClientOperationsMixin, MultiApiClient LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, - 'test_lro': '1.0.0', + 'begin_test_lro': '1.0.0', 'test_one': '2.0.0', }}, _PROFILE_TAG + " latest" diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin_async.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin_async.py index 11552e376da..b8844971c34 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin_async.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin_async.py @@ -20,11 +20,11 @@ class MultiapiServiceClientOperationsMixin(object): - async def test_lro( + async def begin_test_lro( self, product: Optional["models.Product"] = None, **kwargs - ) -> "models.Product": + ) -> AsyncLROPoller["models.Product"]: """Put in whatever shape of Product you want, will return a Product with id equal to 100. :param product: Product to put. @@ -34,7 +34,7 @@ async def test_lro( :rtype: ~multiapiwithsubmodule.submodule.v1.models.Product or None :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = self._get_api_version('test_lro') + api_version = self._get_api_version('begin_test_lro') if api_version == '1.0.0': from ..v1.aio.operations_async import MultiapiServiceClientOperationsMixin as OperationClass else: @@ -44,7 +44,7 @@ async def test_lro( mixin_instance._config = self._config mixin_instance._serialize = Serializer(self._models_dict(api_version)) mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) - return await mixin_instance.test_lro(product, **kwargs) + return await mixin_instance.begin_test_lro(product, **kwargs) async def test_one( self, diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json index 4df1f0d992d..bb1d74396e0 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json @@ -37,11 +37,9 @@ "operation_mixins": { "test_one" : { "sync": { - "operation_name": "test_one", "signature": "def test_one(\n self,\n id, # type: int\n message=None, # type: Optional[str]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "test_one", "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e None:\n", "coroutine": true }, @@ -50,25 +48,21 @@ }, "_test_lro_initial" : { "sync": { - "operation_name": "_test_lro_initial", "signature": "def _test_lro_initial(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "_test_lro_initial", "signature": "async def _test_lro_initial(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e \"models.Product\":\n", "coroutine": true }, "doc": " \"\"\"\n\n:param product: Product to put.\n:type product: ~multiapiwithsubmodule.submodule.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapiwithsubmodule.submodule.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"", "call": "product" }, - "test_lro" : { + "begin_test_lro" : { "sync": { - "operation_name": "begin_test_lro", "signature": "def begin_test_lro(\n self,\n product=None, # type: Optional[\"models.Product\"]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "test_lro", - "signature": "async def test_lro(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e \"models.Product\":\n", + "signature": "async def begin_test_lro(\n self,\n product: Optional[\"models.Product\"] = None,\n **kwargs\n) -\u003e AsyncLROPoller[\"models.Product\"]:\n", "coroutine": true }, "doc": " \"\"\"Put in whatever shape of Product you want, will return a Product with id equal to 100.\n\n:param product: Product to put.\n:type product: ~multiapiwithsubmodule.submodule.v1.models.Product\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Product, or the result of cls(response)\n:rtype: ~multiapiwithsubmodule.submodule.v1.models.Product or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"", diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/_metadata.json index b2a215b7d33..0450cf993d7 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/_metadata.json @@ -38,11 +38,9 @@ "operation_mixins": { "test_one" : { "sync": { - "operation_name": "test_one", "signature": "def test_one(\n self,\n id, # type: int\n message=None, # type: Optional[str]\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "test_one", "signature": "async def test_one(\n self,\n id: int,\n message: Optional[str] = None,\n **kwargs\n) -\u003e \"models.ModelTwo\":\n", "coroutine": true }, diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json index e21e9254f01..bee6b022a45 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json @@ -38,11 +38,9 @@ "operation_mixins": { "test_paging" : { "sync": { - "operation_name": "test_paging", "signature": "def test_paging(\n self,\n **kwargs # type: Any\n):\n" }, "async": { - "operation_name": "test_paging", "signature": "def test_paging(\n self,\n **kwargs\n) -\u003e AsyncItemPaged[\"models.PagingResult\"]:\n", "coroutine": false }, From 7b4ebfd267a316d4d6a30f92f33952a1bac9f8dc Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Wed, 27 May 2020 12:21:59 -0400 Subject: [PATCH 22/26] Lro multiapi merge imports (#651) * fixed async docs and typing * added return type to LROPoller sync typing * merging imports across all versions for multiapi mixins * fixed pylint and mypy --- autorest/codegen/models/__init__.py | 3 +- autorest/codegen/models/imports.py | 20 ++--- .../serializers/metadata_serializer.py | 37 ++++++-- autorest/multiapi/__init__.py | 29 ++++++- autorest/multiapi/models/__init__.py | 13 +++ autorest/multiapi/models/imports.py | 78 +++++++++++++++++ autorest/multiapi/serializers/__init__.py | 13 +++ .../multiapi/serializers/import_serializer.py | 87 +++++++++++++++++++ .../{ => serializers}/multiapi_serializer.py | 2 +- .../Multiapi/multiapi/_operations_mixin.py | 4 +- .../multiapi/aio/_operations_mixin_async.py | 4 +- .../Multiapi/multiapi/v1/_metadata.json | 4 +- .../Multiapi/multiapi/v2/_metadata.json | 4 +- .../Multiapi/multiapi/v3/_metadata.json | 4 +- .../multiapinoasync/_operations_mixin.py | 4 +- .../multiapinoasync/v1/_metadata.json | 4 +- .../multiapinoasync/v2/_metadata.json | 4 +- .../multiapinoasync/v3/_metadata.json | 4 +- .../submodule/_operations_mixin.py | 4 +- .../submodule/aio/_operations_mixin_async.py | 4 +- .../submodule/v1/_metadata.json | 4 +- .../submodule/v2/_metadata.json | 4 +- .../submodule/v3/_metadata.json | 4 +- 23 files changed, 295 insertions(+), 43 deletions(-) create mode 100644 autorest/multiapi/models/__init__.py create mode 100644 autorest/multiapi/models/imports.py create mode 100644 autorest/multiapi/serializers/__init__.py create mode 100644 autorest/multiapi/serializers/import_serializer.py rename autorest/multiapi/{ => serializers}/multiapi_serializer.py (99%) diff --git a/autorest/codegen/models/__init__.py b/autorest/codegen/models/__init__.py index 8b68c5654c2..c52dd8f40b4 100644 --- a/autorest/codegen/models/__init__.py +++ b/autorest/codegen/models/__init__.py @@ -13,7 +13,7 @@ from .enum_schema import EnumSchema from .base_schema import BaseSchema from .constant_schema import ConstantSchema -from .imports import FileImport, ImportType +from .imports import FileImport, ImportType, TypingSection from .lro_operation import LROOperation from .paging_operation import PagingOperation from .parameter import Parameter @@ -36,6 +36,7 @@ "EnumSchema", "FileImport", "ImportType", + "TypingSection", "PrimitiveSchema", "LROOperation", "Operation", diff --git a/autorest/codegen/models/imports.py b/autorest/codegen/models/imports.py index 72a89047566..f855e053018 100644 --- a/autorest/codegen/models/imports.py +++ b/autorest/codegen/models/imports.py @@ -3,20 +3,20 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from enum import Enum, auto +from enum import Enum from typing import Dict, Optional, Set -class ImportType(Enum): - STDLIB = auto() - THIRDPARTY = auto() - AZURECORE = auto() - LOCAL = auto() +class ImportType(str, Enum): + STDLIB = "stdlib" + THIRDPARTY = "thirdparty" + AZURECORE = "azurecore" + LOCAL = "local" -class TypingSection(Enum): - REGULAR = auto() # this import is always a typing import - CONDITIONAL = auto() # is a typing import when we're dealing with files that py2 will use, else regular - TYPING = auto() # never a typing import +class TypingSection(str, Enum): + REGULAR = "regular" # this import is always a typing import + CONDITIONAL = "conditional" # is a typing import when we're dealing with files that py2 will use, else regular + TYPING = "typing" # never a typing import class FileImport: diff --git a/autorest/codegen/serializers/metadata_serializer.py b/autorest/codegen/serializers/metadata_serializer.py index 64e97aba10d..2ec39660c03 100644 --- a/autorest/codegen/serializers/metadata_serializer.py +++ b/autorest/codegen/serializers/metadata_serializer.py @@ -4,7 +4,8 @@ # license information. # -------------------------------------------------------------------------- import copy -from typing import List, Optional, Set, Tuple +import json +from typing import List, Optional, Set, Tuple, Dict from jinja2 import Environment from ..models import ( CodeModel, @@ -13,9 +14,10 @@ LROOperation, PagingOperation, CredentialSchema, - ParameterList + ParameterList, + TypingSection, + ImportType ) -from .import_serializer import FileImportSerializer def _correct_credential_parameter(global_parameters: ParameterList, async_mode: bool) -> None: credential_param = [ @@ -23,6 +25,31 @@ def _correct_credential_parameter(global_parameters: ParameterList, async_mode: ][0] credential_param.schema = CredentialSchema(async_mode=async_mode) +def _json_serialize_imports( + imports: Dict[TypingSection, Dict[ImportType, Dict[str, Set[Optional[str]]]]] +): + if not imports: + return None + + json_serialize_imports = {} + # need to make name_import set -> list to make the dictionary json serializable + # not using an OrderedDict since we're iterating through a set and the order there varies + # going to sort the list instead + + for typing_section_key, typing_section_value in imports.items(): + json_import_type_dictionary = {} + for import_type_key, import_type_value in typing_section_value.items(): + json_package_name_dictionary = {} + for package_name, name_imports in import_type_value.items(): + name_import_ordered_list = [] + if name_imports: + name_import_ordered_list = list(name_imports) + name_import_ordered_list.sort() + json_package_name_dictionary[package_name] = name_import_ordered_list + json_import_type_dictionary[import_type_key] = json_package_name_dictionary + json_serialize_imports[typing_section_key] = json_import_type_dictionary + return json.dumps(json_serialize_imports) + class MetadataSerializer: def __init__(self, code_model: CodeModel, env: Environment) -> None: @@ -99,11 +126,11 @@ def _is_paging(operation): is_paging=_is_paging, str=str, sync_mixin_imports=( - FileImportSerializer(sync_mixin_imports, is_python_3_file=False) + _json_serialize_imports(sync_mixin_imports.imports) if sync_mixin_imports else None ), async_mixin_imports=( - FileImportSerializer(async_mixin_imports, is_python_3_file=True) + _json_serialize_imports(async_mixin_imports.imports) if async_mixin_imports else None ) ) diff --git a/autorest/multiapi/__init__.py b/autorest/multiapi/__init__.py index 07a7ae64b18..4eb279f1a79 100644 --- a/autorest/multiapi/__init__.py +++ b/autorest/multiapi/__init__.py @@ -11,7 +11,8 @@ from collections import defaultdict from pathlib import Path from typing import Dict, List, Tuple, Optional, cast, Any -from .multiapi_serializer import MultiAPISerializer +from .serializers import MultiAPISerializer, FileImportSerializer +from .models import FileImport from ..jsonrpc import AutorestAPI from .. import Plugin @@ -247,6 +248,20 @@ def _parse_package_name_input(self) -> str: self.output_package_name = self.input_package_name return module_name + def _merge_mixin_imports_across_versions( + self, paths_to_versions: List[Path], async_mode: bool + ) -> FileImport: + imports = FileImport() + imports_to_load = "async_imports" if async_mode else "sync_imports" + for version_path in paths_to_versions: + metadata_json = json.loads(self._autorestapi.read_file(version_path / "_metadata.json")) + if not metadata_json.get('operation_mixins'): + continue + current_version_imports = FileImport(json.loads(metadata_json[imports_to_load])) + imports.merge(current_version_imports) + + return imports + def process(self) -> bool: _LOGGER.info("Generating multiapi client") # If True, means the auto-profile will consider preview versions. @@ -324,6 +339,14 @@ def process(self) -> bool: versioned_operations_dict, mixin_operations, last_api_version, preview_mode, async_mode=True ) + sync_imports = self._merge_mixin_imports_across_versions( + paths_to_versions, async_mode=False + ) + + async_imports = self._merge_mixin_imports_across_versions( + paths_to_versions, async_mode=True + ) + conf = { "client_name": metadata_json["client"]["name"], "package_name": self.output_package_name, @@ -340,8 +363,8 @@ def process(self) -> bool: ), "config": metadata_json["config"], "global_parameters": metadata_json["global_parameters"], - "sync_imports": metadata_json["sync_imports"], - "async_imports": metadata_json["async_imports"] + "sync_imports": str(FileImportSerializer(sync_imports, is_python_3_file=False)), + "async_imports": str(FileImportSerializer(async_imports, is_python_3_file=True)) } multiapi_serializer = MultiAPISerializer( diff --git a/autorest/multiapi/models/__init__.py b/autorest/multiapi/models/__init__.py new file mode 100644 index 00000000000..5ac7539c8bc --- /dev/null +++ b/autorest/multiapi/models/__init__.py @@ -0,0 +1,13 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + +from .imports import ImportType, FileImport, TypingSection + +__all__ = [ + "ImportType", + "FileImport", + "TypingSection" +] diff --git a/autorest/multiapi/models/imports.py b/autorest/multiapi/models/imports.py new file mode 100644 index 00000000000..f855e053018 --- /dev/null +++ b/autorest/multiapi/models/imports.py @@ -0,0 +1,78 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from enum import Enum +from typing import Dict, Optional, Set + + +class ImportType(str, Enum): + STDLIB = "stdlib" + THIRDPARTY = "thirdparty" + AZURECORE = "azurecore" + LOCAL = "local" + +class TypingSection(str, Enum): + REGULAR = "regular" # this import is always a typing import + CONDITIONAL = "conditional" # is a typing import when we're dealing with files that py2 will use, else regular + TYPING = "typing" # never a typing import + + +class FileImport: + def __init__( + self, imports: Dict[TypingSection, Dict[ImportType, Dict[str, Set[Optional[str]]]]] = None + ) -> None: + # Basic implementation + # First level dict: TypingSection + # Second level dict: ImportType + # Third level dict: the package name. + # Fourth level set: None if this import is a "import", the name to import if it's a "from" + self._imports: Dict[TypingSection, Dict[ImportType, Dict[str, Set[Optional[str]]]]] = imports or dict() + + def _add_import( + self, + from_section: str, + import_type: ImportType, + name_import: Optional[str] = None, + typing_section: TypingSection = TypingSection.REGULAR + ) -> None: + self._imports.setdefault( + typing_section, dict() + ).setdefault( + import_type, dict() + ).setdefault( + from_section, set() + ).add(name_import) + + def add_from_import( + self, + from_section: str, + name_import: str, + import_type: ImportType, + typing_section: TypingSection = TypingSection.REGULAR + ) -> None: + """Add an import to this import block. + """ + self._add_import(from_section, import_type, name_import, typing_section) + + def add_import( + self, + name_import: str, + import_type: ImportType, + typing_section: TypingSection = TypingSection.REGULAR + ) -> None: + # Implementation detail: a regular import is just a "from" with no from + self._add_import(name_import, import_type, None, typing_section) + + @property + def imports(self) -> Dict[TypingSection, Dict[ImportType, Dict[str, Set[Optional[str]]]]]: + return self._imports + + def merge(self, file_import: "FileImport") -> None: + """Merge the given file import format.""" + for typing_section, import_type_dict in file_import.imports.items(): + for import_type, package_list in import_type_dict.items(): + for package_name, module_list in package_list.items(): + for module_name in module_list: + self._add_import(package_name, import_type, module_name, typing_section) diff --git a/autorest/multiapi/serializers/__init__.py b/autorest/multiapi/serializers/__init__.py new file mode 100644 index 00000000000..92bfc4a46f0 --- /dev/null +++ b/autorest/multiapi/serializers/__init__.py @@ -0,0 +1,13 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + +from .import_serializer import FileImportSerializer +from .multiapi_serializer import MultiAPISerializer + +__all__ = [ + "FileImportSerializer", + "MultiAPISerializer" +] diff --git a/autorest/multiapi/serializers/import_serializer.py b/autorest/multiapi/serializers/import_serializer.py new file mode 100644 index 00000000000..e597a3b9116 --- /dev/null +++ b/autorest/multiapi/serializers/import_serializer.py @@ -0,0 +1,87 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from copy import deepcopy +from typing import Dict, Set, Optional, List +from ..models import ImportType, FileImport, TypingSection + +def _serialize_package(package_name: str, module_list: Set[Optional[str]], delimiter: str) -> str: + buffer = [] + if None in module_list: + buffer.append(f"import {package_name}") + if module_list != {None}: + buffer.append( + "from {} import {}".format( + package_name, ", ".join(sorted([mod for mod in module_list if mod is not None])) + ) + ) + return delimiter.join(buffer) + +def _serialize_type(import_type_dict: Dict[str, Set[Optional[str]]], delimiter: str) -> str: + """Serialize a given import type.""" + import_list = [] + for package_name in sorted(list(import_type_dict.keys())): + module_list = import_type_dict[package_name] + import_list.append(_serialize_package(package_name, module_list, delimiter)) + return delimiter.join(import_list) + +def _get_import_clauses(imports: Dict[ImportType, Dict[str, Set[Optional[str]]]], delimiter: str) -> List[str]: + import_clause = [] + for import_type in ImportType: + if import_type in imports: + import_clause.append(_serialize_type(imports[import_type], delimiter)) + return import_clause + + +class FileImportSerializer: + def __init__(self, file_import: FileImport, is_python_3_file: bool) -> None: + self._file_import = file_import + self.is_python_3_file = is_python_3_file + + def _switch_typing_section_key(self, new_key: TypingSection): + switched_dictionary = {} + switched_dictionary[new_key] = self._file_import.imports[TypingSection.CONDITIONAL] + return switched_dictionary + + def _get_imports_dict(self, baseline_typing_section: TypingSection, add_conditional_typing: bool): + # If this is a python 3 file, our regular imports include the CONDITIONAL category + # If this is not a python 3 file, our typing imports include the CONDITIONAL category + file_import_copy = deepcopy(self._file_import) + if add_conditional_typing and self._file_import.imports.get(TypingSection.CONDITIONAL): + # we switch the TypingSection key for the CONDITIONAL typing imports so we can merge + # the imports together + switched_imports_dictionary = self._switch_typing_section_key(baseline_typing_section) + switched_imports = FileImport(switched_imports_dictionary) + file_import_copy.merge(switched_imports) + return file_import_copy.imports.get(baseline_typing_section, {}) + + def _add_type_checking_import(self): + if ( + self._file_import.imports.get(TypingSection.TYPING) or + (not self.is_python_3_file and self._file_import.imports.get(TypingSection.CONDITIONAL)) + ): + self._file_import.add_from_import("typing", "TYPE_CHECKING", ImportType.STDLIB) + + def __str__(self) -> str: + self._add_type_checking_import() + regular_imports = "" + regular_imports_dict = self._get_imports_dict( + baseline_typing_section=TypingSection.REGULAR, add_conditional_typing=self.is_python_3_file + ) + + if regular_imports_dict: + regular_imports = "\n\n".join( + _get_import_clauses(regular_imports_dict, "\n") + ) + + typing_imports = "" + typing_imports_dict = self._get_imports_dict( + baseline_typing_section=TypingSection.TYPING, add_conditional_typing=not self.is_python_3_file + ) + if typing_imports_dict: + typing_imports += "\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n " + typing_imports += "\n\n ".join(_get_import_clauses(typing_imports_dict, "\n ")) + + return regular_imports + typing_imports diff --git a/autorest/multiapi/multiapi_serializer.py b/autorest/multiapi/serializers/multiapi_serializer.py similarity index 99% rename from autorest/multiapi/multiapi_serializer.py rename to autorest/multiapi/serializers/multiapi_serializer.py index 869677ad7cd..27c53ebfca2 100644 --- a/autorest/multiapi/multiapi_serializer.py +++ b/autorest/multiapi/serializers/multiapi_serializer.py @@ -7,7 +7,7 @@ from pathlib import Path from jinja2 import Environment, PackageLoader -from ..jsonrpc import AutorestAPI +from ...jsonrpc import AutorestAPI class MultiAPISerializer: diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/_operations_mixin.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/_operations_mixin.py index e53cbcf6409..34857142110 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/_operations_mixin.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/_operations_mixin.py @@ -16,10 +16,12 @@ from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.polling.base_polling import LROBasePolling if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union class MultiapiServiceClientOperationsMixin(object): diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin_async.py b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin_async.py index a4af9a328a8..2a9e9278dc6 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin_async.py +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/aio/_operations_mixin_async.py @@ -9,13 +9,15 @@ # regenerated. # -------------------------------------------------------------------------- from msrest import Serializer, Deserializer -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling.async_base_polling import AsyncLROBasePolling class MultiapiServiceClientOperationsMixin(object): diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json index 0082bc1ecd8..86f3abb7a30 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v1/_metadata.json @@ -69,6 +69,6 @@ "call": "product" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.core.polling import LROPoller, NoPolling, PollingMethod\nfrom azure.core.polling.base_polling import LROBasePolling\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod\nfrom azure.core.polling.async_base_polling import AsyncLROBasePolling" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.polling\": [\"LROPoller\", \"NoPolling\", \"PollingMethod\"], \"azure.core.polling.base_polling\": [\"LROBasePolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.polling\": [\"AsyncLROPoller\", \"AsyncNoPolling\", \"AsyncPollingMethod\"], \"azure.core.polling.async_base_polling\": [\"AsyncLROBasePolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}" } \ No newline at end of file diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/_metadata.json b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/_metadata.json index bcfd8aaf876..7cdd0320de7 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v2/_metadata.json @@ -48,6 +48,6 @@ "call": "id, message" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json index 5953fe8f741..11d13eaf335 100644 --- a/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/Multiapi/multiapi/v3/_metadata.json @@ -48,6 +48,6 @@ "call": "" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.paging import ItemPaged\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar", - "async_imports": "from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.async_paging import AsyncItemPaged, AsyncList\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Iterable\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/_operations_mixin.py b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/_operations_mixin.py index 389fa6cc5a1..a0197a7ff1a 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/_operations_mixin.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/_operations_mixin.py @@ -16,10 +16,12 @@ from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.polling.base_polling import LROBasePolling if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union class MultiapiServiceClientOperationsMixin(object): diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json index b47ebb898b9..efd0e307ad3 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v1/_metadata.json @@ -69,6 +69,6 @@ "call": "product" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.core.polling import LROPoller, NoPolling, PollingMethod\nfrom azure.core.polling.base_polling import LROBasePolling\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod\nfrom azure.core.polling.async_base_polling import AsyncLROBasePolling" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.polling\": [\"LROPoller\", \"NoPolling\", \"PollingMethod\"], \"azure.core.polling.base_polling\": [\"LROBasePolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.polling\": [\"AsyncLROPoller\", \"AsyncNoPolling\", \"AsyncPollingMethod\"], \"azure.core.polling.async_base_polling\": [\"AsyncLROBasePolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}" } \ No newline at end of file diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/_metadata.json index 0323f54a015..91a96cac25e 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v2/_metadata.json @@ -48,6 +48,6 @@ "call": "id, message" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json index 40e1a20d0fa..5f89c882881 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiNoAsync/multiapinoasync/v3/_metadata.json @@ -48,6 +48,6 @@ "call": "" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.paging import ItemPaged\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar", - "async_imports": "from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.async_paging import AsyncItemPaged, AsyncList\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Iterable\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/_operations_mixin.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/_operations_mixin.py index 07febfed3c6..1a6fb890ee0 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/_operations_mixin.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/_operations_mixin.py @@ -16,10 +16,12 @@ from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.polling.base_polling import LROBasePolling if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union class MultiapiServiceClientOperationsMixin(object): diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin_async.py b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin_async.py index b8844971c34..fd8d44748f0 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin_async.py +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/aio/_operations_mixin_async.py @@ -9,13 +9,15 @@ # regenerated. # -------------------------------------------------------------------------- from msrest import Serializer, Deserializer -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling.async_base_polling import AsyncLROBasePolling class MultiapiServiceClientOperationsMixin(object): diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json index bb1d74396e0..972cfaee6e9 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v1/_metadata.json @@ -69,6 +69,6 @@ "call": "product" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.core.polling import LROPoller, NoPolling, PollingMethod\nfrom azure.core.polling.base_polling import LROBasePolling\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest\nfrom azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod\nfrom azure.core.polling.async_base_polling import AsyncLROBasePolling" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.polling\": [\"LROPoller\", \"NoPolling\", \"PollingMethod\"], \"azure.core.polling.base_polling\": [\"LROBasePolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.polling\": [\"AsyncLROPoller\", \"AsyncNoPolling\", \"AsyncPollingMethod\"], \"azure.core.polling.async_base_polling\": [\"AsyncLROBasePolling\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\", \"Union\"]}}}" } \ No newline at end of file diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/_metadata.json index 0450cf993d7..028534fcf94 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v2/_metadata.json @@ -48,6 +48,6 @@ "call": "id, message" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Optional, TypeVar", - "async_imports": "from typing import Any, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file diff --git a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json index bee6b022a45..dc8d442255d 100644 --- a/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json +++ b/test/multiapi/Expected/AcceptanceTests/MultiapiWithSubmodule/multiapiwithsubmodule/submodule/v3/_metadata.json @@ -48,6 +48,6 @@ "call": "" } }, - "sync_imports": "from typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.paging import ItemPaged\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar", - "async_imports": "from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar\nimport warnings\n\nfrom azure.core.async_paging import AsyncItemPaged, AsyncList\nfrom azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest" + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Iterable\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}" } \ No newline at end of file From cc51b644fe4f30aa57bab08a768b286c2ad97d9b Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Wed, 3 Jun 2020 15:05:15 -0700 Subject: [PATCH 23/26] azure-core 1.6.0 is released --- test/azure/requirements.txt | 2 +- test/multiapi/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/azure/requirements.txt b/test/azure/requirements.txt index ec0c0f3ced7..3c72c29496a 100644 --- a/test/azure/requirements.txt +++ b/test/azure/requirements.txt @@ -3,7 +3,7 @@ pytest pytest-cov pytest-asyncio==0.10.0;python_full_version>="3.5.2" async_generator;python_full_version>="3.5.2" -git+https://github.com/Azure/azure-sdk-for-python#subdirectory=sdk/core/azure-core&egg=azure-core +azure-core>=1.6.0 azure-mgmt-core>=1.1.0 msrest>=0.6.10 aiohttp;python_full_version>="3.5.2" diff --git a/test/multiapi/requirements.txt b/test/multiapi/requirements.txt index 7147f610d10..6bd0d2baece 100644 --- a/test/multiapi/requirements.txt +++ b/test/multiapi/requirements.txt @@ -1,5 +1,5 @@ msrest>=0.6.11 -git+https://github.com/Azure/azure-sdk-for-python#subdirectory=sdk/core/azure-core&egg=azure-core +azure-core>=1.6.0 azure-mgmt-core>=1.1.0 pytest pytest-asyncio==0.10.0;python_full_version>="3.5.2" From fada35a96b133b7d75649a0b093b9dacdbdc5bd4 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Wed, 3 Jun 2020 15:16:36 -0700 Subject: [PATCH 24/26] Upgrade changelog --- ChangeLog.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index e66c8e61b00..2dfc663f2c8 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,6 @@ # Change Log -### 2020-05-22 - 5.1.0-preview.1 +### 2020-06-03 - 5.1.0-preview.1 Modelerfour version: 4.13.351 **Disclaimer** @@ -10,6 +10,7 @@ This version requires azure-core 1.6.0 and contains features and bugfixes 5.0.0- **Features** - Refactor async LRO poller with a AsyncLROPoller class + "begin_" prefix +- Add continuation_token kwargs to LRO methods **Bug Fixes** - Corrected generation of the item name of paging response when extracting data #648 From 934177a72e68a8cbb32623afc121b6e9e1ba369d Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Wed, 3 Jun 2020 15:42:42 -0700 Subject: [PATCH 25/26] Last testserver --- .../_paging_operations_async.py | 59 ++++++++++++++++++ .../Paging/paging/models/__init__.py | 3 + .../Paging/paging/models/_models.py | 23 +++++++ .../Paging/paging/models/_models_py3.py | 26 ++++++++ .../paging/operations/_paging_operations.py | 60 +++++++++++++++++++ .../_string_operations_async.py | 10 ++-- .../operations/_string_operations.py | 10 ++-- 7 files changed, 181 insertions(+), 10 deletions(-) diff --git a/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py b/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py index 6323aa0a10f..2a8062cbbbe 100644 --- a/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py +++ b/test/azure/Expected/AcceptanceTests/Paging/paging/aio/operations_async/_paging_operations_async.py @@ -1080,3 +1080,62 @@ def get_long_running_output(pipeline_response): else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_get_multiple_pages_lro.metadata = {'url': '/paging/multiple/lro'} # type: ignore + + @distributed_trace + def get_paging_model_with_item_name_with_xms_client_name( + self, + **kwargs + ) -> AsyncIterable["models.ProductResultValueWithXMSClientName"]: + """A paging operation that returns a paging model whose item name is is overriden by x-ms-client- + name 'indexes'. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductResultValueWithXMSClientName or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~paging.models.ProductResultValueWithXMSClientName] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResultValueWithXMSClientName"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + if not next_link: + # Construct URL + url = self.get_paging_model_with_item_name_with_xms_client_name.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ProductResultValueWithXMSClientName', pipeline_response) + list_of_elem = deserialized.indexes + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + get_paging_model_with_item_name_with_xms_client_name.metadata = {'url': '/paging/itemNameWithXMSClientName'} # type: ignore diff --git a/test/azure/Expected/AcceptanceTests/Paging/paging/models/__init__.py b/test/azure/Expected/AcceptanceTests/Paging/paging/models/__init__.py index 7b47cf9c471..865518351bf 100644 --- a/test/azure/Expected/AcceptanceTests/Paging/paging/models/__init__.py +++ b/test/azure/Expected/AcceptanceTests/Paging/paging/models/__init__.py @@ -18,6 +18,7 @@ from ._models_py3 import ProductProperties from ._models_py3 import ProductResult from ._models_py3 import ProductResultValue + from ._models_py3 import ProductResultValueWithXMSClientName except (SyntaxError, ImportError): from ._models import CustomParameterGroup # type: ignore from ._models import OdataProductResult # type: ignore @@ -30,6 +31,7 @@ from ._models import ProductProperties # type: ignore from ._models import ProductResult # type: ignore from ._models import ProductResultValue # type: ignore + from ._models import ProductResultValueWithXMSClientName # type: ignore from ._auto_rest_paging_test_service_enums import ( OperationResultStatus, @@ -47,5 +49,6 @@ 'ProductProperties', 'ProductResult', 'ProductResultValue', + 'ProductResultValueWithXMSClientName', 'OperationResultStatus', ] diff --git a/test/azure/Expected/AcceptanceTests/Paging/paging/models/_models.py b/test/azure/Expected/AcceptanceTests/Paging/paging/models/_models.py index 9f3232171bb..34d9c17d658 100644 --- a/test/azure/Expected/AcceptanceTests/Paging/paging/models/_models.py +++ b/test/azure/Expected/AcceptanceTests/Paging/paging/models/_models.py @@ -275,3 +275,26 @@ def __init__( super(ProductResultValue, self).__init__(**kwargs) self.value = kwargs.get('value', None) self.next_link = kwargs.get('next_link', None) + + +class ProductResultValueWithXMSClientName(msrest.serialization.Model): + """ProductResultValueWithXMSClientName. + + :param indexes: + :type indexes: list[~paging.models.Product] + :param next_link: + :type next_link: str + """ + + _attribute_map = { + 'indexes': {'key': 'values', 'type': '[Product]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProductResultValueWithXMSClientName, self).__init__(**kwargs) + self.indexes = kwargs.get('indexes', None) + self.next_link = kwargs.get('next_link', None) diff --git a/test/azure/Expected/AcceptanceTests/Paging/paging/models/_models_py3.py b/test/azure/Expected/AcceptanceTests/Paging/paging/models/_models_py3.py index 8bffe0e249f..54edeb96bc6 100644 --- a/test/azure/Expected/AcceptanceTests/Paging/paging/models/_models_py3.py +++ b/test/azure/Expected/AcceptanceTests/Paging/paging/models/_models_py3.py @@ -311,3 +311,29 @@ def __init__( super(ProductResultValue, self).__init__(**kwargs) self.value = value self.next_link = next_link + + +class ProductResultValueWithXMSClientName(msrest.serialization.Model): + """ProductResultValueWithXMSClientName. + + :param indexes: + :type indexes: list[~paging.models.Product] + :param next_link: + :type next_link: str + """ + + _attribute_map = { + 'indexes': {'key': 'values', 'type': '[Product]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + indexes: Optional[List["Product"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(ProductResultValueWithXMSClientName, self).__init__(**kwargs) + self.indexes = indexes + self.next_link = next_link diff --git a/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py b/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py index c30eb428c57..9043a40b4d9 100644 --- a/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py +++ b/test/azure/Expected/AcceptanceTests/Paging/paging/operations/_paging_operations.py @@ -1099,3 +1099,63 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_get_multiple_pages_lro.metadata = {'url': '/paging/multiple/lro'} # type: ignore + + @distributed_trace + def get_paging_model_with_item_name_with_xms_client_name( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ProductResultValueWithXMSClientName"] + """A paging operation that returns a paging model whose item name is is overriden by x-ms-client- + name 'indexes'. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProductResultValueWithXMSClientName or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~paging.models.ProductResultValueWithXMSClientName] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ProductResultValueWithXMSClientName"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + if not next_link: + # Construct URL + url = self.get_paging_model_with_item_name_with_xms_client_name.metadata['url'] # type: ignore + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ProductResultValueWithXMSClientName', pipeline_response) + list_of_elem = deserialized.indexes + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + get_paging_model_with_item_name_with_xms_client_name.metadata = {'url': '/paging/itemNameWithXMSClientName'} # type: ignore diff --git a/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/aio/operations_async/_string_operations_async.py b/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/aio/operations_async/_string_operations_async.py index 4ac4736575b..c71130a62f3 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/aio/operations_async/_string_operations_async.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/aio/operations_async/_string_operations_async.py @@ -452,15 +452,15 @@ async def get_not_provided( async def get_base64_encoded( self, **kwargs - ) -> bytes: + ) -> bytearray: """Get value that is base64 encoded. :keyword callable cls: A custom type or function that will be passed the direct response - :return: bytes, or the result of cls(response) - :rtype: bytes + :return: bytearray, or the result of cls(response) + :rtype: bytearray :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[bytes] + cls = kwargs.pop('cls', None) # type: ClsType[bytearray] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) @@ -483,7 +483,7 @@ async def get_base64_encoded( error = self._deserialize(models.Error, response) raise HttpResponseError(response=response, model=error) - deserialized = self._deserialize('base64', pipeline_response) + deserialized = self._deserialize('bytearray', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/operations/_string_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/operations/_string_operations.py index 486edc4ad09..c377ba629b9 100644 --- a/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/operations/_string_operations.py +++ b/test/vanilla/Expected/AcceptanceTests/BodyString/bodystring/operations/_string_operations.py @@ -466,15 +466,15 @@ def get_base64_encoded( self, **kwargs # type: Any ): - # type: (...) -> bytes + # type: (...) -> bytearray """Get value that is base64 encoded. :keyword callable cls: A custom type or function that will be passed the direct response - :return: bytes, or the result of cls(response) - :rtype: bytes + :return: bytearray, or the result of cls(response) + :rtype: bytearray :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[bytes] + cls = kwargs.pop('cls', None) # type: ClsType[bytearray] error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} error_map.update(kwargs.pop('error_map', {})) @@ -497,7 +497,7 @@ def get_base64_encoded( error = self._deserialize(models.Error, response) raise HttpResponseError(response=response, model=error) - deserialized = self._deserialize('base64', pipeline_response) + deserialized = self._deserialize('bytearray', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) From b5d08a5c26bf28b30ddc9df271ca94beaba13f04 Mon Sep 17 00:00:00 2001 From: Laurent Mazuel Date: Wed, 3 Jun 2020 15:54:18 -0700 Subject: [PATCH 26/26] Missing folder --- .../multipleinheritance/__init__.py | 19 + .../multipleinheritance/_configuration.py | 50 ++ .../_multiple_inheritance_service_client.py | 57 ++ .../multipleinheritance/_version.py | 9 + .../multipleinheritance/aio/__init__.py | 10 + .../aio/_configuration_async.py | 44 ++ ...ltiple_inheritance_service_client_async.py | 49 ++ .../aio/operations_async/__init__.py | 13 + ...ritance_service_client_operations_async.py | 496 +++++++++++++++++ .../multipleinheritance/models/__init__.py | 31 ++ .../multipleinheritance/models/_models.py | 184 +++++++ .../multipleinheritance/models/_models_py3.py | 208 +++++++ .../operations/__init__.py | 13 + ...e_inheritance_service_client_operations.py | 510 ++++++++++++++++++ .../multipleinheritance/py.typed | 1 + .../MultipleInheritance/setup.py | 37 ++ 16 files changed, 1731 insertions(+) create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/__init__.py create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/_configuration.py create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/_multiple_inheritance_service_client.py create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/_version.py create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/__init__.py create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/_configuration_async.py create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/_multiple_inheritance_service_client_async.py create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations_async/__init__.py create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations_async/_multiple_inheritance_service_client_operations_async.py create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/models/__init__.py create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/models/_models.py create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/models/_models_py3.py create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/__init__.py create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/_multiple_inheritance_service_client_operations.py create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/py.typed create mode 100644 test/vanilla/Expected/AcceptanceTests/MultipleInheritance/setup.py diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/__init__.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/__init__.py new file mode 100644 index 00000000000..ec4ce84d210 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._multiple_inheritance_service_client import MultipleInheritanceServiceClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['MultipleInheritanceServiceClient'] + +try: + from ._patch import patch_sdk + patch_sdk() +except ImportError: + pass diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/_configuration.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/_configuration.py new file mode 100644 index 00000000000..9934d7190b2 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/_configuration.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + +class MultipleInheritanceServiceClientConfiguration(Configuration): + """Configuration for MultipleInheritanceServiceClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + """ + + def __init__( + self, + **kwargs # type: Any + ): + # type: (...) -> None + super(MultipleInheritanceServiceClientConfiguration, self).__init__(**kwargs) + + kwargs.setdefault('sdk_moniker', 'multipleinheritanceserviceclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/_multiple_inheritance_service_client.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/_multiple_inheritance_service_client.py new file mode 100644 index 00000000000..35ee8dc223a --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/_multiple_inheritance_service_client.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core import PipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + +from ._configuration import MultipleInheritanceServiceClientConfiguration +from .operations import MultipleInheritanceServiceClientOperationsMixin +from . import models + + +class MultipleInheritanceServiceClient(MultipleInheritanceServiceClientOperationsMixin): + """Service client for multiinheritance client testing. + + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'http://localhost:3000' + self._config = MultipleInheritanceServiceClientConfiguration(**kwargs) + self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> MultipleInheritanceServiceClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/_version.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/_version.py new file mode 100644 index 00000000000..eae7c95b6fb --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/__init__.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/__init__.py new file mode 100644 index 00000000000..e04768551ec --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._multiple_inheritance_service_client_async import MultipleInheritanceServiceClient +__all__ = ['MultipleInheritanceServiceClient'] diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/_configuration_async.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/_configuration_async.py new file mode 100644 index 00000000000..1a1c36c9fa6 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/_configuration_async.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +from .._version import VERSION + + +class MultipleInheritanceServiceClientConfiguration(Configuration): + """Configuration for MultipleInheritanceServiceClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + """ + + def __init__( + self, + **kwargs: Any + ) -> None: + super(MultipleInheritanceServiceClientConfiguration, self).__init__(**kwargs) + + kwargs.setdefault('sdk_moniker', 'multipleinheritanceserviceclient/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/_multiple_inheritance_service_client_async.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/_multiple_inheritance_service_client_async.py new file mode 100644 index 00000000000..a619abd7410 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/_multiple_inheritance_service_client_async.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Optional + +from azure.core import AsyncPipelineClient +from msrest import Deserializer, Serializer + +from ._configuration_async import MultipleInheritanceServiceClientConfiguration +from .operations_async import MultipleInheritanceServiceClientOperationsMixin +from .. import models + + +class MultipleInheritanceServiceClient(MultipleInheritanceServiceClientOperationsMixin): + """Service client for multiinheritance client testing. + + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'http://localhost:3000' + self._config = MultipleInheritanceServiceClientConfiguration(**kwargs) + self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "MultipleInheritanceServiceClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations_async/__init__.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations_async/__init__.py new file mode 100644 index 00000000000..2411f4731dd --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations_async/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._multiple_inheritance_service_client_operations_async import MultipleInheritanceServiceClientOperationsMixin + +__all__ = [ + 'MultipleInheritanceServiceClientOperationsMixin', +] diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations_async/_multiple_inheritance_service_client_operations_async.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations_async/_multiple_inheritance_service_client_operations_async.py new file mode 100644 index 00000000000..2a213e04c2d --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/aio/operations_async/_multiple_inheritance_service_client_operations_async.py @@ -0,0 +1,496 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MultipleInheritanceServiceClientOperationsMixin: + + @distributed_trace_async + async def get_horse( + self, + **kwargs + ) -> "models.Horse": + """Get a horse with name 'Fred' and isAShowHorse true. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Horse, or the result of cls(response) + :rtype: ~multipleinheritance.models.Horse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Horse"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_horse.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Horse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_horse.metadata = {'url': '/multipleInheritance/horse'} # type: ignore + + @distributed_trace_async + async def put_horse( + self, + horse: "models.Horse", + **kwargs + ) -> str: + """Put a horse with name 'General' and isAShowHorse false. + + :param horse: Put a horse with name 'General' and isAShowHorse false. + :type horse: ~multipleinheritance.models.Horse + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_horse.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(horse, 'Horse') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_horse.metadata = {'url': '/multipleInheritance/horse'} # type: ignore + + @distributed_trace_async + async def get_pet( + self, + **kwargs + ) -> "models.Pet": + """Get a pet with name 'Peanut'. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Pet, or the result of cls(response) + :rtype: ~multipleinheritance.models.Pet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Pet"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_pet.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Pet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_pet.metadata = {'url': '/multipleInheritance/pet'} # type: ignore + + @distributed_trace_async + async def put_pet( + self, + name: str, + **kwargs + ) -> str: + """Put a pet with name 'Butter'. + + :param name: + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + _pet = models.Pet(name=name) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_pet.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_pet, 'Pet') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_pet.metadata = {'url': '/multipleInheritance/pet'} # type: ignore + + @distributed_trace_async + async def get_feline( + self, + **kwargs + ) -> "models.Feline": + """Get a feline where meows and hisses are true. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Feline, or the result of cls(response) + :rtype: ~multipleinheritance.models.Feline + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Feline"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_feline.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Feline', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_feline.metadata = {'url': '/multipleInheritance/feline'} # type: ignore + + @distributed_trace_async + async def put_feline( + self, + feline: "models.Feline", + **kwargs + ) -> str: + """Put a feline who hisses and doesn't meow. + + :param feline: Put a feline who hisses and doesn't meow. + :type feline: ~multipleinheritance.models.Feline + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_feline.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(feline, 'Feline') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_feline.metadata = {'url': '/multipleInheritance/feline'} # type: ignore + + @distributed_trace_async + async def get_cat( + self, + **kwargs + ) -> "models.Cat": + """Get a cat with name 'Whiskers' where likesMilk, meows, and hisses is true. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Cat, or the result of cls(response) + :rtype: ~multipleinheritance.models.Cat + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Cat"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_cat.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Cat', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_cat.metadata = {'url': '/multipleInheritance/cat'} # type: ignore + + @distributed_trace_async + async def put_cat( + self, + cat: "models.Cat", + **kwargs + ) -> str: + """Put a cat with name 'Boots' where likesMilk and hisses is false, meows is true. + + :param cat: Put a cat with name 'Boots' where likesMilk and hisses is false, meows is true. + :type cat: ~multipleinheritance.models.Cat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_cat.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(cat, 'Cat') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_cat.metadata = {'url': '/multipleInheritance/cat'} # type: ignore + + @distributed_trace_async + async def get_kitten( + self, + **kwargs + ) -> "models.Kitten": + """Get a kitten with name 'Gatito' where likesMilk and meows is true, and hisses and eatsMiceYet + is false. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Kitten, or the result of cls(response) + :rtype: ~multipleinheritance.models.Kitten + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Kitten"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_kitten.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Kitten', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_kitten.metadata = {'url': '/multipleInheritance/kitten'} # type: ignore + + @distributed_trace_async + async def put_kitten( + self, + kitten: "models.Kitten", + **kwargs + ) -> str: + """Put a kitten with name 'Kitty' where likesMilk and hisses is false, meows and eatsMiceYet is + true. + + :param kitten: Put a kitten with name 'Kitty' where likesMilk and hisses is false, meows and + eatsMiceYet is true. + :type kitten: ~multipleinheritance.models.Kitten + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_kitten.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(kitten, 'Kitten') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_kitten.metadata = {'url': '/multipleInheritance/kitten'} # type: ignore diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/models/__init__.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/models/__init__.py new file mode 100644 index 00000000000..8c9e96065f7 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/models/__init__.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import Cat + from ._models_py3 import Error + from ._models_py3 import Feline + from ._models_py3 import Horse + from ._models_py3 import Kitten + from ._models_py3 import Pet +except (SyntaxError, ImportError): + from ._models import Cat # type: ignore + from ._models import Error # type: ignore + from ._models import Feline # type: ignore + from ._models import Horse # type: ignore + from ._models import Kitten # type: ignore + from ._models import Pet # type: ignore + +__all__ = [ + 'Cat', + 'Error', + 'Feline', + 'Horse', + 'Kitten', + 'Pet', +] diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/models/_models.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/models/_models.py new file mode 100644 index 00000000000..cc3875bbef9 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/models/_models.py @@ -0,0 +1,184 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Feline(msrest.serialization.Model): + """Feline. + + :param meows: + :type meows: bool + :param hisses: + :type hisses: bool + """ + + _attribute_map = { + 'meows': {'key': 'meows', 'type': 'bool'}, + 'hisses': {'key': 'hisses', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Feline, self).__init__(**kwargs) + self.meows = kwargs.get('meows', None) + self.hisses = kwargs.get('hisses', None) + + +class Pet(msrest.serialization.Model): + """Pet. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Pet, self).__init__(**kwargs) + self.name = kwargs['name'] + + +class Cat(Pet, Feline): + """Cat. + + All required parameters must be populated in order to send to Azure. + + :param meows: + :type meows: bool + :param hisses: + :type hisses: bool + :param name: Required. + :type name: str + :param likes_milk: + :type likes_milk: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'meows': {'key': 'meows', 'type': 'bool'}, + 'hisses': {'key': 'hisses', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'likes_milk': {'key': 'likesMilk', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Cat, self).__init__(**kwargs) + self.meows = kwargs.get('meows', None) + self.hisses = kwargs.get('hisses', None) + self.likes_milk = kwargs.get('likes_milk', None) + self.name = kwargs['name'] + self.likes_milk = kwargs.get('likes_milk', None) + + +class Error(msrest.serialization.Model): + """Error. + + :param status: + :type status: int + :param message: + :type message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'int'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Error, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.message = kwargs.get('message', None) + + +class Horse(Pet): + """Horse. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :param is_a_show_horse: + :type is_a_show_horse: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_a_show_horse': {'key': 'isAShowHorse', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Horse, self).__init__(**kwargs) + self.is_a_show_horse = kwargs.get('is_a_show_horse', None) + + +class Kitten(Cat): + """Kitten. + + All required parameters must be populated in order to send to Azure. + + :param meows: + :type meows: bool + :param hisses: + :type hisses: bool + :param name: Required. + :type name: str + :param likes_milk: + :type likes_milk: bool + :param eats_mice_yet: + :type eats_mice_yet: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'meows': {'key': 'meows', 'type': 'bool'}, + 'hisses': {'key': 'hisses', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'likes_milk': {'key': 'likesMilk', 'type': 'bool'}, + 'eats_mice_yet': {'key': 'eatsMiceYet', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Kitten, self).__init__(**kwargs) + self.eats_mice_yet = kwargs.get('eats_mice_yet', None) diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/models/_models_py3.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/models/_models_py3.py new file mode 100644 index 00000000000..b40439c1a36 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/models/_models_py3.py @@ -0,0 +1,208 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Optional + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Feline(msrest.serialization.Model): + """Feline. + + :param meows: + :type meows: bool + :param hisses: + :type hisses: bool + """ + + _attribute_map = { + 'meows': {'key': 'meows', 'type': 'bool'}, + 'hisses': {'key': 'hisses', 'type': 'bool'}, + } + + def __init__( + self, + *, + meows: Optional[bool] = None, + hisses: Optional[bool] = None, + **kwargs + ): + super(Feline, self).__init__(**kwargs) + self.meows = meows + self.hisses = hisses + + +class Pet(msrest.serialization.Model): + """Pet. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + **kwargs + ): + super(Pet, self).__init__(**kwargs) + self.name = name + + +class Cat(Pet, Feline): + """Cat. + + All required parameters must be populated in order to send to Azure. + + :param meows: + :type meows: bool + :param hisses: + :type hisses: bool + :param name: Required. + :type name: str + :param likes_milk: + :type likes_milk: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'meows': {'key': 'meows', 'type': 'bool'}, + 'hisses': {'key': 'hisses', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'likes_milk': {'key': 'likesMilk', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: str, + meows: Optional[bool] = None, + hisses: Optional[bool] = None, + likes_milk: Optional[bool] = None, + **kwargs + ): + super(Cat, self).__init__(name=name, meows=meows, hisses=hisses, **kwargs) + self.meows = meows + self.hisses = hisses + self.likes_milk = likes_milk + self.name = name + self.likes_milk = likes_milk + + +class Error(msrest.serialization.Model): + """Error. + + :param status: + :type status: int + :param message: + :type message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'int'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[int] = None, + message: Optional[str] = None, + **kwargs + ): + super(Error, self).__init__(**kwargs) + self.status = status + self.message = message + + +class Horse(Pet): + """Horse. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :param is_a_show_horse: + :type is_a_show_horse: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_a_show_horse': {'key': 'isAShowHorse', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: str, + is_a_show_horse: Optional[bool] = None, + **kwargs + ): + super(Horse, self).__init__(name=name, **kwargs) + self.is_a_show_horse = is_a_show_horse + + +class Kitten(Cat): + """Kitten. + + All required parameters must be populated in order to send to Azure. + + :param meows: + :type meows: bool + :param hisses: + :type hisses: bool + :param name: Required. + :type name: str + :param likes_milk: + :type likes_milk: bool + :param eats_mice_yet: + :type eats_mice_yet: bool + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'meows': {'key': 'meows', 'type': 'bool'}, + 'hisses': {'key': 'hisses', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'likes_milk': {'key': 'likesMilk', 'type': 'bool'}, + 'eats_mice_yet': {'key': 'eatsMiceYet', 'type': 'bool'}, + } + + def __init__( + self, + *, + name: str, + meows: Optional[bool] = None, + hisses: Optional[bool] = None, + likes_milk: Optional[bool] = None, + eats_mice_yet: Optional[bool] = None, + **kwargs + ): + super(Kitten, self).__init__(meows=meows, hisses=hisses, name=name, likes_milk=likes_milk, **kwargs) + self.eats_mice_yet = eats_mice_yet diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/__init__.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/__init__.py new file mode 100644 index 00000000000..4afee8c7842 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._multiple_inheritance_service_client_operations import MultipleInheritanceServiceClientOperationsMixin + +__all__ = [ + 'MultipleInheritanceServiceClientOperationsMixin', +] diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/_multiple_inheritance_service_client_operations.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/_multiple_inheritance_service_client_operations.py new file mode 100644 index 00000000000..b50a1ea2b49 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/operations/_multiple_inheritance_service_client_operations.py @@ -0,0 +1,510 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MultipleInheritanceServiceClientOperationsMixin(object): + + @distributed_trace + def get_horse( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.Horse" + """Get a horse with name 'Fred' and isAShowHorse true. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Horse, or the result of cls(response) + :rtype: ~multipleinheritance.models.Horse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Horse"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_horse.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Horse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_horse.metadata = {'url': '/multipleInheritance/horse'} # type: ignore + + @distributed_trace + def put_horse( + self, + horse, # type: "models.Horse" + **kwargs # type: Any + ): + # type: (...) -> str + """Put a horse with name 'General' and isAShowHorse false. + + :param horse: Put a horse with name 'General' and isAShowHorse false. + :type horse: ~multipleinheritance.models.Horse + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_horse.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(horse, 'Horse') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_horse.metadata = {'url': '/multipleInheritance/horse'} # type: ignore + + @distributed_trace + def get_pet( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.Pet" + """Get a pet with name 'Peanut'. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Pet, or the result of cls(response) + :rtype: ~multipleinheritance.models.Pet + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Pet"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_pet.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Pet', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_pet.metadata = {'url': '/multipleInheritance/pet'} # type: ignore + + @distributed_trace + def put_pet( + self, + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> str + """Put a pet with name 'Butter'. + + :param name: + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + _pet = models.Pet(name=name) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_pet.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_pet, 'Pet') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_pet.metadata = {'url': '/multipleInheritance/pet'} # type: ignore + + @distributed_trace + def get_feline( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.Feline" + """Get a feline where meows and hisses are true. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Feline, or the result of cls(response) + :rtype: ~multipleinheritance.models.Feline + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Feline"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_feline.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Feline', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_feline.metadata = {'url': '/multipleInheritance/feline'} # type: ignore + + @distributed_trace + def put_feline( + self, + feline, # type: "models.Feline" + **kwargs # type: Any + ): + # type: (...) -> str + """Put a feline who hisses and doesn't meow. + + :param feline: Put a feline who hisses and doesn't meow. + :type feline: ~multipleinheritance.models.Feline + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_feline.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(feline, 'Feline') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_feline.metadata = {'url': '/multipleInheritance/feline'} # type: ignore + + @distributed_trace + def get_cat( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.Cat" + """Get a cat with name 'Whiskers' where likesMilk, meows, and hisses is true. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Cat, or the result of cls(response) + :rtype: ~multipleinheritance.models.Cat + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Cat"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_cat.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Cat', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_cat.metadata = {'url': '/multipleInheritance/cat'} # type: ignore + + @distributed_trace + def put_cat( + self, + cat, # type: "models.Cat" + **kwargs # type: Any + ): + # type: (...) -> str + """Put a cat with name 'Boots' where likesMilk and hisses is false, meows is true. + + :param cat: Put a cat with name 'Boots' where likesMilk and hisses is false, meows is true. + :type cat: ~multipleinheritance.models.Cat + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_cat.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(cat, 'Cat') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_cat.metadata = {'url': '/multipleInheritance/cat'} # type: ignore + + @distributed_trace + def get_kitten( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.Kitten" + """Get a kitten with name 'Gatito' where likesMilk and meows is true, and hisses and eatsMiceYet + is false. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Kitten, or the result of cls(response) + :rtype: ~multipleinheritance.models.Kitten + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.Kitten"] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_kitten.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('Kitten', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_kitten.metadata = {'url': '/multipleInheritance/kitten'} # type: ignore + + @distributed_trace + def put_kitten( + self, + kitten, # type: "models.Kitten" + **kwargs # type: Any + ): + # type: (...) -> str + """Put a kitten with name 'Kitty' where likesMilk and hisses is false, meows and eatsMiceYet is + true. + + :param kitten: Put a kitten with name 'Kitty' where likesMilk and hisses is false, meows and + eatsMiceYet is true. + :type kitten: ~multipleinheritance.models.Kitten + :keyword callable cls: A custom type or function that will be passed the direct response + :return: str, or the result of cls(response) + :rtype: str + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[str] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_kitten.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = 'application/json' + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(kitten, 'Kitten') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + deserialized = self._deserialize('str', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + put_kitten.metadata = {'url': '/multipleInheritance/kitten'} # type: ignore diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/py.typed b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/multipleinheritance/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/setup.py b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/setup.py new file mode 100644 index 00000000000..6bff09e9f36 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/MultipleInheritance/setup.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# coding: utf-8 + +from setuptools import setup, find_packages + +NAME = "multipleinheritanceserviceclient" +VERSION = "0.1.0" + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["msrest>=0.6.0", "azure-core<2.0.0,>=1.2.0"] + +setup( + name=NAME, + version=VERSION, + description="MultipleInheritanceServiceClient", + author_email="", + url="", + keywords=["Swagger", "MultipleInheritanceServiceClient"], + install_requires=REQUIRES, + packages=find_packages(), + include_package_data=True, + long_description="""\ + Service client for multiinheritance client testing. + """ +)