// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/vision/v1p3beta1/product_search_service.proto

package com.google.cloud.vision.v1p3beta1;

/**
 *
 *
 * <pre>
 * A `ReferenceImage` represents a product image and its associated metadata,
 * such as bounding boxes.
 * </pre>
 *
 * Protobuf type {@code google.cloud.vision.v1p3beta1.ReferenceImage}
 */
public final class ReferenceImage extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.vision.v1p3beta1.ReferenceImage)
    ReferenceImageOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ReferenceImage.newBuilder() to construct.
  private ReferenceImage(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ReferenceImage() {
    name_ = "";
    uri_ = "";
    boundingPolys_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private ReferenceImage(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10:
            {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
          case 18:
            {
              java.lang.String s = input.readStringRequireUtf8();

              uri_ = s;
              break;
            }
          case 26:
            {
              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
                boundingPolys_ =
                    new java.util.ArrayList<com.google.cloud.vision.v1p3beta1.BoundingPoly>();
                mutable_bitField0_ |= 0x00000004;
              }
              boundingPolys_.add(
                  input.readMessage(
                      com.google.cloud.vision.v1p3beta1.BoundingPoly.parser(), extensionRegistry));
              break;
            }
          default:
            {
              if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
        boundingPolys_ = java.util.Collections.unmodifiableList(boundingPolys_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto
        .internal_static_google_cloud_vision_v1p3beta1_ReferenceImage_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto
        .internal_static_google_cloud_vision_v1p3beta1_ReferenceImage_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.vision.v1p3beta1.ReferenceImage.class,
            com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder.class);
  }

  private int bitField0_;
  public static final int NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object name_;
  /**
   *
   *
   * <pre>
   * The resource name of the reference image.
   * Format is:
   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
   * This field is ignored when creating a reference image.
   * </pre>
   *
   * <code>string name = 1;</code>
   */
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      name_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The resource name of the reference image.
   * Format is:
   * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
   * This field is ignored when creating a reference image.
   * </pre>
   *
   * <code>string name = 1;</code>
   */
  public com.google.protobuf.ByteString getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      name_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int URI_FIELD_NUMBER = 2;
  private volatile java.lang.Object uri_;
  /**
   *
   *
   * <pre>
   * The Google Cloud Storage URI of the reference image.
   * The URI must start with `gs://`.
   * Required.
   * </pre>
   *
   * <code>string uri = 2;</code>
   */
  public java.lang.String getUri() {
    java.lang.Object ref = uri_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      uri_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The Google Cloud Storage URI of the reference image.
   * The URI must start with `gs://`.
   * Required.
   * </pre>
   *
   * <code>string uri = 2;</code>
   */
  public com.google.protobuf.ByteString getUriBytes() {
    java.lang.Object ref = uri_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      uri_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int BOUNDING_POLYS_FIELD_NUMBER = 3;
  private java.util.List<com.google.cloud.vision.v1p3beta1.BoundingPoly> boundingPolys_;
  /**
   *
   *
   * <pre>
   * Bounding polygons around the areas of interest in the reference image.
   * Optional. If this field is empty, the system will try to detect regions of
   * interest. At most 10 bounding polygons will be used.
   * The provided shape is converted into a non-rotated rectangle. Once
   * converted, the small edge of the rectangle must be greater than or equal
   * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
   * is not).
   * </pre>
   *
   * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
   */
  public java.util.List<com.google.cloud.vision.v1p3beta1.BoundingPoly> getBoundingPolysList() {
    return boundingPolys_;
  }
  /**
   *
   *
   * <pre>
   * Bounding polygons around the areas of interest in the reference image.
   * Optional. If this field is empty, the system will try to detect regions of
   * interest. At most 10 bounding polygons will be used.
   * The provided shape is converted into a non-rotated rectangle. Once
   * converted, the small edge of the rectangle must be greater than or equal
   * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
   * is not).
   * </pre>
   *
   * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
   */
  public java.util.List<? extends com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>
      getBoundingPolysOrBuilderList() {
    return boundingPolys_;
  }
  /**
   *
   *
   * <pre>
   * Bounding polygons around the areas of interest in the reference image.
   * Optional. If this field is empty, the system will try to detect regions of
   * interest. At most 10 bounding polygons will be used.
   * The provided shape is converted into a non-rotated rectangle. Once
   * converted, the small edge of the rectangle must be greater than or equal
   * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
   * is not).
   * </pre>
   *
   * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
   */
  public int getBoundingPolysCount() {
    return boundingPolys_.size();
  }
  /**
   *
   *
   * <pre>
   * Bounding polygons around the areas of interest in the reference image.
   * Optional. If this field is empty, the system will try to detect regions of
   * interest. At most 10 bounding polygons will be used.
   * The provided shape is converted into a non-rotated rectangle. Once
   * converted, the small edge of the rectangle must be greater than or equal
   * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
   * is not).
   * </pre>
   *
   * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
   */
  public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPolys(int index) {
    return boundingPolys_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Bounding polygons around the areas of interest in the reference image.
   * Optional. If this field is empty, the system will try to detect regions of
   * interest. At most 10 bounding polygons will be used.
   * The provided shape is converted into a non-rotated rectangle. Once
   * converted, the small edge of the rectangle must be greater than or equal
   * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
   * is not).
   * </pre>
   *
   * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
   */
  public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolysOrBuilder(
      int index) {
    return boundingPolys_.get(index);
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!getNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (!getUriBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uri_);
    }
    for (int i = 0; i < boundingPolys_.size(); i++) {
      output.writeMessage(3, boundingPolys_.get(i));
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!getNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (!getUriBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uri_);
    }
    for (int i = 0; i < boundingPolys_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, boundingPolys_.get(i));
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.vision.v1p3beta1.ReferenceImage)) {
      return super.equals(obj);
    }
    com.google.cloud.vision.v1p3beta1.ReferenceImage other =
        (com.google.cloud.vision.v1p3beta1.ReferenceImage) obj;

    boolean result = true;
    result = result && getName().equals(other.getName());
    result = result && getUri().equals(other.getUri());
    result = result && getBoundingPolysList().equals(other.getBoundingPolysList());
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    hash = (37 * hash) + URI_FIELD_NUMBER;
    hash = (53 * hash) + getUri().hashCode();
    if (getBoundingPolysCount() > 0) {
      hash = (37 * hash) + BOUNDING_POLYS_FIELD_NUMBER;
      hash = (53 * hash) + getBoundingPolysList().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.vision.v1p3beta1.ReferenceImage parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.cloud.vision.v1p3beta1.ReferenceImage prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * A `ReferenceImage` represents a product image and its associated metadata,
   * such as bounding boxes.
   * </pre>
   *
   * Protobuf type {@code google.cloud.vision.v1p3beta1.ReferenceImage}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p3beta1.ReferenceImage)
      com.google.cloud.vision.v1p3beta1.ReferenceImageOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto
          .internal_static_google_cloud_vision_v1p3beta1_ReferenceImage_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto
          .internal_static_google_cloud_vision_v1p3beta1_ReferenceImage_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.vision.v1p3beta1.ReferenceImage.class,
              com.google.cloud.vision.v1p3beta1.ReferenceImage.Builder.class);
    }

    // Construct using com.google.cloud.vision.v1p3beta1.ReferenceImage.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
        getBoundingPolysFieldBuilder();
      }
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      name_ = "";

      uri_ = "";

      if (boundingPolysBuilder_ == null) {
        boundingPolys_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
      } else {
        boundingPolysBuilder_.clear();
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.vision.v1p3beta1.ProductSearchServiceProto
          .internal_static_google_cloud_vision_v1p3beta1_ReferenceImage_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.vision.v1p3beta1.ReferenceImage getDefaultInstanceForType() {
      return com.google.cloud.vision.v1p3beta1.ReferenceImage.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.vision.v1p3beta1.ReferenceImage build() {
      com.google.cloud.vision.v1p3beta1.ReferenceImage result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.vision.v1p3beta1.ReferenceImage buildPartial() {
      com.google.cloud.vision.v1p3beta1.ReferenceImage result =
          new com.google.cloud.vision.v1p3beta1.ReferenceImage(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.name_ = name_;
      result.uri_ = uri_;
      if (boundingPolysBuilder_ == null) {
        if (((bitField0_ & 0x00000004) == 0x00000004)) {
          boundingPolys_ = java.util.Collections.unmodifiableList(boundingPolys_);
          bitField0_ = (bitField0_ & ~0x00000004);
        }
        result.boundingPolys_ = boundingPolys_;
      } else {
        result.boundingPolys_ = boundingPolysBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return (Builder) super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return (Builder) super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.vision.v1p3beta1.ReferenceImage) {
        return mergeFrom((com.google.cloud.vision.v1p3beta1.ReferenceImage) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.vision.v1p3beta1.ReferenceImage other) {
      if (other == com.google.cloud.vision.v1p3beta1.ReferenceImage.getDefaultInstance())
        return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (!other.getUri().isEmpty()) {
        uri_ = other.uri_;
        onChanged();
      }
      if (boundingPolysBuilder_ == null) {
        if (!other.boundingPolys_.isEmpty()) {
          if (boundingPolys_.isEmpty()) {
            boundingPolys_ = other.boundingPolys_;
            bitField0_ = (bitField0_ & ~0x00000004);
          } else {
            ensureBoundingPolysIsMutable();
            boundingPolys_.addAll(other.boundingPolys_);
          }
          onChanged();
        }
      } else {
        if (!other.boundingPolys_.isEmpty()) {
          if (boundingPolysBuilder_.isEmpty()) {
            boundingPolysBuilder_.dispose();
            boundingPolysBuilder_ = null;
            boundingPolys_ = other.boundingPolys_;
            bitField0_ = (bitField0_ & ~0x00000004);
            boundingPolysBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getBoundingPolysFieldBuilder()
                    : null;
          } else {
            boundingPolysBuilder_.addAllMessages(other.boundingPolys_);
          }
        }
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.cloud.vision.v1p3beta1.ReferenceImage parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.vision.v1p3beta1.ReferenceImage) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * The resource name of the reference image.
     * Format is:
     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
     * This field is ignored when creating a reference image.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name of the reference image.
     * Format is:
     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
     * This field is ignored when creating a reference image.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public com.google.protobuf.ByteString getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name of the reference image.
     * Format is:
     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
     * This field is ignored when creating a reference image.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public Builder setName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      name_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name of the reference image.
     * Format is:
     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
     * This field is ignored when creating a reference image.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name of the reference image.
     * Format is:
     * `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`.
     * This field is ignored when creating a reference image.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public Builder setNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      name_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object uri_ = "";
    /**
     *
     *
     * <pre>
     * The Google Cloud Storage URI of the reference image.
     * The URI must start with `gs://`.
     * Required.
     * </pre>
     *
     * <code>string uri = 2;</code>
     */
    public java.lang.String getUri() {
      java.lang.Object ref = uri_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        uri_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The Google Cloud Storage URI of the reference image.
     * The URI must start with `gs://`.
     * Required.
     * </pre>
     *
     * <code>string uri = 2;</code>
     */
    public com.google.protobuf.ByteString getUriBytes() {
      java.lang.Object ref = uri_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        uri_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The Google Cloud Storage URI of the reference image.
     * The URI must start with `gs://`.
     * Required.
     * </pre>
     *
     * <code>string uri = 2;</code>
     */
    public Builder setUri(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      uri_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The Google Cloud Storage URI of the reference image.
     * The URI must start with `gs://`.
     * Required.
     * </pre>
     *
     * <code>string uri = 2;</code>
     */
    public Builder clearUri() {

      uri_ = getDefaultInstance().getUri();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The Google Cloud Storage URI of the reference image.
     * The URI must start with `gs://`.
     * Required.
     * </pre>
     *
     * <code>string uri = 2;</code>
     */
    public Builder setUriBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      uri_ = value;
      onChanged();
      return this;
    }

    private java.util.List<com.google.cloud.vision.v1p3beta1.BoundingPoly> boundingPolys_ =
        java.util.Collections.emptyList();

    private void ensureBoundingPolysIsMutable() {
      if (!((bitField0_ & 0x00000004) == 0x00000004)) {
        boundingPolys_ =
            new java.util.ArrayList<com.google.cloud.vision.v1p3beta1.BoundingPoly>(boundingPolys_);
        bitField0_ |= 0x00000004;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.vision.v1p3beta1.BoundingPoly,
            com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder,
            com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>
        boundingPolysBuilder_;

    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public java.util.List<com.google.cloud.vision.v1p3beta1.BoundingPoly> getBoundingPolysList() {
      if (boundingPolysBuilder_ == null) {
        return java.util.Collections.unmodifiableList(boundingPolys_);
      } else {
        return boundingPolysBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public int getBoundingPolysCount() {
      if (boundingPolysBuilder_ == null) {
        return boundingPolys_.size();
      } else {
        return boundingPolysBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public com.google.cloud.vision.v1p3beta1.BoundingPoly getBoundingPolys(int index) {
      if (boundingPolysBuilder_ == null) {
        return boundingPolys_.get(index);
      } else {
        return boundingPolysBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public Builder setBoundingPolys(
        int index, com.google.cloud.vision.v1p3beta1.BoundingPoly value) {
      if (boundingPolysBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureBoundingPolysIsMutable();
        boundingPolys_.set(index, value);
        onChanged();
      } else {
        boundingPolysBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public Builder setBoundingPolys(
        int index, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) {
      if (boundingPolysBuilder_ == null) {
        ensureBoundingPolysIsMutable();
        boundingPolys_.set(index, builderForValue.build());
        onChanged();
      } else {
        boundingPolysBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public Builder addBoundingPolys(com.google.cloud.vision.v1p3beta1.BoundingPoly value) {
      if (boundingPolysBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureBoundingPolysIsMutable();
        boundingPolys_.add(value);
        onChanged();
      } else {
        boundingPolysBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public Builder addBoundingPolys(
        int index, com.google.cloud.vision.v1p3beta1.BoundingPoly value) {
      if (boundingPolysBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureBoundingPolysIsMutable();
        boundingPolys_.add(index, value);
        onChanged();
      } else {
        boundingPolysBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public Builder addBoundingPolys(
        com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) {
      if (boundingPolysBuilder_ == null) {
        ensureBoundingPolysIsMutable();
        boundingPolys_.add(builderForValue.build());
        onChanged();
      } else {
        boundingPolysBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public Builder addBoundingPolys(
        int index, com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder builderForValue) {
      if (boundingPolysBuilder_ == null) {
        ensureBoundingPolysIsMutable();
        boundingPolys_.add(index, builderForValue.build());
        onChanged();
      } else {
        boundingPolysBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public Builder addAllBoundingPolys(
        java.lang.Iterable<? extends com.google.cloud.vision.v1p3beta1.BoundingPoly> values) {
      if (boundingPolysBuilder_ == null) {
        ensureBoundingPolysIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, boundingPolys_);
        onChanged();
      } else {
        boundingPolysBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public Builder clearBoundingPolys() {
      if (boundingPolysBuilder_ == null) {
        boundingPolys_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
        onChanged();
      } else {
        boundingPolysBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public Builder removeBoundingPolys(int index) {
      if (boundingPolysBuilder_ == null) {
        ensureBoundingPolysIsMutable();
        boundingPolys_.remove(index);
        onChanged();
      } else {
        boundingPolysBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder getBoundingPolysBuilder(
        int index) {
      return getBoundingPolysFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder getBoundingPolysOrBuilder(
        int index) {
      if (boundingPolysBuilder_ == null) {
        return boundingPolys_.get(index);
      } else {
        return boundingPolysBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public java.util.List<? extends com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>
        getBoundingPolysOrBuilderList() {
      if (boundingPolysBuilder_ != null) {
        return boundingPolysBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(boundingPolys_);
      }
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder addBoundingPolysBuilder() {
      return getBoundingPolysFieldBuilder()
          .addBuilder(com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder addBoundingPolysBuilder(
        int index) {
      return getBoundingPolysFieldBuilder()
          .addBuilder(index, com.google.cloud.vision.v1p3beta1.BoundingPoly.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Bounding polygons around the areas of interest in the reference image.
     * Optional. If this field is empty, the system will try to detect regions of
     * interest. At most 10 bounding polygons will be used.
     * The provided shape is converted into a non-rotated rectangle. Once
     * converted, the small edge of the rectangle must be greater than or equal
     * to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5
     * is not).
     * </pre>
     *
     * <code>repeated .google.cloud.vision.v1p3beta1.BoundingPoly bounding_polys = 3;</code>
     */
    public java.util.List<com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder>
        getBoundingPolysBuilderList() {
      return getBoundingPolysFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.vision.v1p3beta1.BoundingPoly,
            com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder,
            com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>
        getBoundingPolysFieldBuilder() {
      if (boundingPolysBuilder_ == null) {
        boundingPolysBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.vision.v1p3beta1.BoundingPoly,
                com.google.cloud.vision.v1p3beta1.BoundingPoly.Builder,
                com.google.cloud.vision.v1p3beta1.BoundingPolyOrBuilder>(
                boundingPolys_,
                ((bitField0_ & 0x00000004) == 0x00000004),
                getParentForChildren(),
                isClean());
        boundingPolys_ = null;
      }
      return boundingPolysBuilder_;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p3beta1.ReferenceImage)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ReferenceImage)
  private static final com.google.cloud.vision.v1p3beta1.ReferenceImage DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.vision.v1p3beta1.ReferenceImage();
  }

  public static com.google.cloud.vision.v1p3beta1.ReferenceImage getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<ReferenceImage> PARSER =
      new com.google.protobuf.AbstractParser<ReferenceImage>() {
        @java.lang.Override
        public ReferenceImage parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new ReferenceImage(input, extensionRegistry);
        }
      };

  public static com.google.protobuf.Parser<ReferenceImage> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<ReferenceImage> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.vision.v1p3beta1.ReferenceImage getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
