public final ReferenceImage createReferenceImage(CreateReferenceImageRequest request) {
    return createReferenceImageCallable().call(request);
  }
Creates and returns a new ReferenceImage resource.

<p>The `bounding_poly` field is optional. If `bounding_poly` is not specified, the system will
try to detect regions of interest in the image that are compatible with the product_category on
the parent product. If it is specified, detection is ALWAYS skipped. The system converts
polygons into non-rotated rectangles.

<p>Note that the pipeline will resize the image if the image resolution is too large to process
(above 50MP).

<p>Possible errors:

<ul>
  <li>Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters.
  <li>Returns INVALID_ARGUMENT if the product does not exist.
  <li>Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with
      the parent product's product_category is detected.
  <li>Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
</ul>

<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 (ProductSearchClient productSearchClient = ProductSearchClient.create()) {
  CreateReferenceImageRequest request =
      CreateReferenceImageRequest.newBuilder()
          .setParent(ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]").toString())
          .setReferenceImage(ReferenceImage.newBuilder().build())
          .setReferenceImageId("referenceImageId1224107531")
          .build();
  ReferenceImage response = productSearchClient.createReferenceImage(request);
}
}</pre>

@param request The request object containing all of the parameters for the API call.
@throws com.google.api.gax.rpc.ApiException if the remote call fails
java-vision/google-cloud-vision/src/main/java/com/google/cloud/vision/v1p3beta1/ProductSearchClient.java