code: public final Policy setIamPolicy(QueueName resource, Policy policy) {
  
      SetIamPolicyRequest request =
          SetIamPolicyRequest.newBuilder()
              .setResource(resource == null ? null : resource.toString())
              .setPolicy(policy)
              .build();
      return setIamPolicy(request);
    }
docs: Sets the access control policy for a [Queue][google.cloud.tasks.v2.Queue]. Replaces any
  existing policy.
  
  <p>Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level
  permissions are required to use the Cloud Console.
  
  <p>Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission
  on the specified resource parent:
  
  <p>&#42; `cloudtasks.queues.setIamPolicy`
  
  <p>Sample code:
  
  <pre><code>
  try (CloudTasksClient cloudTasksClient = CloudTasksClient.create()) {
  QueueName resource = QueueName.of("[PROJECT]", "[LOCATION]", "[QUEUE]");
  Policy policy = Policy.newBuilder().build();
  Policy response = cloudTasksClient.setIamPolicy(resource, policy);
  }
  </code></pre>
  
  @param resource REQUIRED: The resource for which the policy is being specified. `resource` is
  usually specified as a path. For example, a Project resource is specified as
  `projects/{project}`.
  @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the
  policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud
  Platform services (such as Projects) might reject them.
  @throws com.google.api.gax.rpc.ApiException if the remote call fails