public final Queue pauseQueue(String name) {
    PauseQueueRequest request = PauseQueueRequest.newBuilder().setName(name).build();
    return pauseQueue(request);
  }
Pauses the queue.

<p>If a queue is paused then the system will stop dispatching tasks until the queue is resumed
via [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue]. Tasks can still be added when
the queue is paused. A queue is paused if its [state][google.cloud.tasks.v2.Queue.state] is
[PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED].

<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()) {
  String name = QueueName.of("[PROJECT]", "[LOCATION]", "[QUEUE]").toString();
  Queue response = cloudTasksClient.pauseQueue(name);
}
}</pre>

@param name Required. The queue name. For example:
    `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
@throws com.google.api.gax.rpc.ApiException if the remote call fails
java-tasks/google-cloud-tasks/src/main/java/com/google/cloud/tasks/v2/CloudTasksClient.java