async def delete(self, group_name: str, service_name: str, project_name: str, task_name: str, delete_running_tasks: Optional[bool]=None, **kwargs) -> None:
    "Delete task.\n\n        The tasks resource is a nested, proxy-only resource representing work performed by a DMS\n        instance. The DELETE method deletes a task, canceling it first if it's running.\n\n        :param group_name: Name of the resource group.\n        :type group_name: str\n        :param service_name: Name of the service.\n        :type service_name: str\n        :param project_name: Name of the project.\n        :type project_name: str\n        :param task_name: Name of the Task.\n        :type task_name: str\n        :param delete_running_tasks: Delete the resource even if it contains running tasks.\n        :type delete_running_tasks: bool\n        :keyword callable cls: A custom type or function that will be passed the direct response\n        :return: None, or the result of cls(response)\n        :rtype: None\n        :raises: ~azure.core.exceptions.HttpResponseError\n        "
    cls = kwargs.pop('cls', None)
    error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
    error_map.update(kwargs.pop('error_map', {}))
    api_version = '2021-10-30-preview'
    accept = 'application/json'
    url = self.delete.metadata['url']
    path_format_arguments = {'subscriptionId': self._serialize.url('self._config.subscription_id', self._config.subscription_id, 'str'), 'groupName': self._serialize.url('group_name', group_name, 'str'), 'serviceName': self._serialize.url('service_name', service_name, 'str'), 'projectName': self._serialize.url('project_name', project_name, 'str'), 'taskName': self._serialize.url('task_name', task_name, 'str')}
    url = self._client.format_url(url, **path_format_arguments)
    query_parameters = {}
    query_parameters['api-version'] = self._serialize.query('api_version', api_version, 'str')
    if (delete_running_tasks is not None):
        query_parameters['deleteRunningTasks'] = self._serialize.query('delete_running_tasks', delete_running_tasks, 'bool')
    header_parameters = {}
    header_parameters['Accept'] = self._serialize.header('accept', accept, 'str')
    request = self._client.delete(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, 204]):
        map_error(status_code=response.status_code, response=response, error_map=error_map)
        error = self._deserialize(models.ApiError, response)
        raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
    if cls:
        return cls(pipeline_response, None, {})
Delete task.

The tasks resource is a nested, proxy-only resource representing work performed by a DMS
instance. The DELETE method deletes a task, canceling it first if it's running.

:param group_name: Name of the resource group.
:type group_name: str
:param service_name: Name of the service.
:type service_name: str
:param project_name: Name of the project.
:type project_name: str
:param task_name: Name of the Task.
:type task_name: str
:param delete_running_tasks: Delete the resource even if it contains running tasks.
:type delete_running_tasks: bool
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
async def delete(self, group_name: str, service_name: str, project_name: str, task_name: str, delete_running_tasks: Optional[bool]=None, **kwargs) -> None:
    "Delete task.\n\n        The tasks resource is a nested, proxy-only resource representing work performed by a DMS\n        instance. The DELETE method deletes a task, canceling it first if it's running.\n\n        :param group_name: Name of the resource group.\n        :type group_name: str\n        :param service_name: Name of the service.\n        :type service_name: str\n        :param project_name: Name of the project.\n        :type project_name: str\n        :param task_name: Name of the Task.\n        :type task_name: str\n        :param delete_running_tasks: Delete the resource even if it contains running tasks.\n        :type delete_running_tasks: bool\n        :keyword callable cls: A custom type or function that will be passed the direct response\n        :return: None, or the result of cls(response)\n        :rtype: None\n        :raises: ~azure.core.exceptions.HttpResponseError\n        "
    cls = kwargs.pop('cls', None)
    error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
    error_map.update(kwargs.pop('error_map', {}))
    api_version = '2021-10-30-preview'
    accept = 'application/json'
    url = self.delete.metadata['url']
    path_format_arguments = {'subscriptionId': self._serialize.url('self._config.subscription_id', self._config.subscription_id, 'str'), 'groupName': self._serialize.url('group_name', group_name, 'str'), 'serviceName': self._serialize.url('service_name', service_name, 'str'), 'projectName': self._serialize.url('project_name', project_name, 'str'), 'taskName': self._serialize.url('task_name', task_name, 'str')}
    url = self._client.format_url(url, **path_format_arguments)
    query_parameters = {}
    query_parameters['api-version'] = self._serialize.query('api_version', api_version, 'str')
    if (delete_running_tasks is not None):
        query_parameters['deleteRunningTasks'] = self._serialize.query('delete_running_tasks', delete_running_tasks, 'bool')
    header_parameters = {}
    header_parameters['Accept'] = self._serialize.header('accept', accept, 'str')
    request = self._client.delete(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, 204]):
        map_error(status_code=response.status_code, response=response, error_map=error_map)
        error = self._deserialize(models.ApiError, response)
        raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
    if cls:
        return cls(pipeline_response, None, {})