code: public final Task renewLease(TaskName name, Timestamp scheduleTime, Duration leaseDuration) {
  
      RenewLeaseRequest request =
          RenewLeaseRequest.newBuilder()
              .setName(name == null ? null : name.toString())
              .setScheduleTime(scheduleTime)
              .setLeaseDuration(leaseDuration)
              .build();
      return renewLease(request);
    }
docs: Renew the current lease of a pull task.
  
  <p>The worker can use this method to extend the lease by a new duration, starting from now. The
  new task lease will be returned in the task's
  [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time].
  
  <p>Sample code:
  
  <pre><code>
  try (CloudTasksClient cloudTasksClient = CloudTasksClient.create()) {
  TaskName name = TaskName.of("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]");
  Timestamp scheduleTime = Timestamp.newBuilder().build();
  Duration leaseDuration = Duration.newBuilder().build();
  Task response = cloudTasksClient.renewLease(name, scheduleTime, leaseDuration);
  }
  </code></pre>
  
  @param name Required.
  <p>The task name. For example:
  `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
  @param scheduleTime Required.
  <p>The task's current schedule time, available in the
  [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time] returned by
  [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] response or
  [RenewLease][google.cloud.tasks.v2beta2.CloudTasks.RenewLease] response. This restriction
  is to ensure that your worker currently holds the lease.
  @param leaseDuration Required.
  <p>The desired new lease duration, starting from now.
  <p>The maximum lease duration is 1 week. `lease_duration` will be truncated to the nearest
  second.
  @throws com.google.api.gax.rpc.ApiException if the remote call fails