code: public final void deleteTask(String name) {
  
      DeleteTaskRequest request = DeleteTaskRequest.newBuilder().setName(name).build();
      deleteTask(request);
    }
docs: Deletes a task.
  
  <p>A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has
  executed successfully or permanently failed.
  
  <p>Sample code:
  
  <pre><code>
  try (CloudTasksClient cloudTasksClient = CloudTasksClient.create()) {
  TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]");
  cloudTasksClient.deleteTask(name.toString());
  }
  </code></pre>
  
  @param name Required.
  <p>The task name. For example:
  `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
  @throws com.google.api.gax.rpc.ApiException if the remote call fails