public final Collection updateCollection(Collection collection, FieldMask updateMask) {
    UpdateCollectionRequest request =
        UpdateCollectionRequest.newBuilder()
            .setCollection(collection)
            .setUpdateMask(updateMask)
            .build();
    return updateCollection(request);
  }
Updates a collection.

<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 (WarehouseClient warehouseClient = WarehouseClient.create()) {
  Collection collection = Collection.newBuilder().build();
  FieldMask updateMask = FieldMask.newBuilder().build();
  Collection response = warehouseClient.updateCollection(collection, updateMask);
}
}</pre>

@param collection Required. The collection to update.
    <p>The collection's `name` field is used to identify the collection to be updated. Format:
    `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}`
@param updateMask The list of fields to be updated. - Unset `update_mask` or set `update_mask`
    to be a single "&#42;" only will update all updatable fields with the value provided in
    `collection`. - To update `display_name` value to empty string, set it in the `collection`
    to empty string, and set `update_mask` with "display_name". Same applies to other updatable
    string fields in the `collection`.
@throws com.google.api.gax.rpc.ApiException if the remote call fails
java-visionai/google-cloud-visionai/src/main/java/com/google/cloud/visionai/v1/WarehouseClient.java