public final Queue updateQueue(Queue queue, FieldMask updateMask) {
    UpdateQueueRequest request =
        UpdateQueueRequest.newBuilder().setQueue(queue).setUpdateMask(updateMask).build();
    return updateQueue(request);
  }
Updates a queue.

<p>This method creates the queue if it does not exist and updates the queue if it does exist.

<p>Queues created with this method allow tasks to live for a maximum of 31 days. After a task
is 31 days old, the task will be deleted regardless of whether it was dispatched or not.

<p>WARNING: Using this method may have unintended side effects if you are using an App Engine
`queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and
queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.

<p>Sample code:

<pre>{@code
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (CloudTasksClient cloudTasksClient = CloudTasksClient.create()) {
  Queue queue = Queue.newBuilder().build();
  FieldMask updateMask = FieldMask.newBuilder().build();
  Queue response = cloudTasksClient.updateQueue(queue, updateMask);
}
}</pre>

@param queue Required. The queue to create or update.
    <p>The queue's [name][google.cloud.tasks.v2beta3.Queue.name] must be specified.
    <p>Output only fields cannot be modified using UpdateQueue. Any value specified for an
    output only field will be ignored. The queue's
    [name][google.cloud.tasks.v2beta3.Queue.name] cannot be changed.
@param updateMask A mask used to specify which fields of the queue are being updated.
    <p>If empty, then all fields will be updated.
@throws com.google.api.gax.rpc.ApiException if the remote call fails
java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2beta3/CloudTasksClient.java