@distributed_trace
def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) -> LROPoller[None]:
    'Cancels the current virtual machine scale set rolling upgrade.\n\n        :param resource_group_name: The name of the resource group.\n        :type resource_group_name: str\n        :param vm_scale_set_name: The name of the VM scale set.\n        :type vm_scale_set_name: str\n        :keyword callable cls: A custom type or function that will be passed the direct response\n        :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n        :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n         operation to not poll, or pass in your own initialized polling object for a personal polling\n         strategy.\n        :paramtype polling: bool or ~azure.core.polling.PollingMethod\n        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n         Retry-After header is present.\n        :return: An instance of LROPoller that returns either None or the result of cls(response)\n        :rtype: ~azure.core.polling.LROPoller[None]\n        :raises: ~azure.core.exceptions.HttpResponseError\n        '
    api_version = kwargs.pop('api_version', '2021-07-01')
    polling = kwargs.pop('polling', True)
    cls = kwargs.pop('cls', None)
    lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
    cont_token = kwargs.pop('continuation_token', None)
    if (cont_token is None):
        raw_result = self._cancel_initial(resource_group_name=resource_group_name, vm_scale_set_name=vm_scale_set_name, api_version=api_version, cls=(lambda x, y, z: x), **kwargs)
    kwargs.pop('error_map', None)

    def get_long_running_output(pipeline_response):
        if cls:
            return cls(pipeline_response, None, {})
    if (polling is True):
        polling_method = ARMPolling(lro_delay, **kwargs)
    elif (polling is False):
        polling_method = NoPolling()
    else:
        polling_method = polling
    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)
    return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
Cancels the current virtual machine scale set rolling upgrade.

:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param vm_scale_set_name: The name of the VM scale set.
:type vm_scale_set_name: 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: By default, your polling method will be ARMPolling. Pass in False for this
 operation to not poll, or pass in your own initialized polling object for a personal polling
 strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
 Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises: ~azure.core.exceptions.HttpResponseError
@distributed_trace
def begin_cancel(self, resource_group_name: str, vm_scale_set_name: str, **kwargs: Any) -> LROPoller[None]:
    'Cancels the current virtual machine scale set rolling upgrade.\n\n        :param resource_group_name: The name of the resource group.\n        :type resource_group_name: str\n        :param vm_scale_set_name: The name of the VM scale set.\n        :type vm_scale_set_name: str\n        :keyword callable cls: A custom type or function that will be passed the direct response\n        :keyword str continuation_token: A continuation token to restart a poller from a saved state.\n        :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n         operation to not poll, or pass in your own initialized polling object for a personal polling\n         strategy.\n        :paramtype polling: bool or ~azure.core.polling.PollingMethod\n        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n         Retry-After header is present.\n        :return: An instance of LROPoller that returns either None or the result of cls(response)\n        :rtype: ~azure.core.polling.LROPoller[None]\n        :raises: ~azure.core.exceptions.HttpResponseError\n        '
    api_version = kwargs.pop('api_version', '2021-07-01')
    polling = kwargs.pop('polling', True)
    cls = kwargs.pop('cls', None)
    lro_delay = kwargs.pop('polling_interval', self._config.polling_interval)
    cont_token = kwargs.pop('continuation_token', None)
    if (cont_token is None):
        raw_result = self._cancel_initial(resource_group_name=resource_group_name, vm_scale_set_name=vm_scale_set_name, api_version=api_version, cls=(lambda x, y, z: x), **kwargs)
    kwargs.pop('error_map', None)

    def get_long_running_output(pipeline_response):
        if cls:
            return cls(pipeline_response, None, {})
    if (polling is True):
        polling_method = ARMPolling(lro_delay, **kwargs)
    elif (polling is False):
        polling_method = NoPolling()
    else:
        polling_method = polling
    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)
    return LROPoller(self._client, raw_result, get_long_running_output, polling_method)