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

@param parent Required. Resource name of the product in which to create the reference image.
    <p>Format is `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.
@param referenceImage Required. The reference image to create. If an image ID is specified, it
    is ignored.
@param referenceImageId A user-supplied resource id for the ReferenceImage to be added. If set,
    the server will attempt to use this value as the resource id. If it is already in use, an
    error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot
    contain the character `/`.
@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