// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/talent/v4beta1/common.proto

package com.google.cloud.talent.v4beta1;

/**
 *
 *
 * <pre>
 * Output only. A resource that represents a location with full geographic
 * information.
 * </pre>
 *
 * Protobuf type {@code google.cloud.talent.v4beta1.Location}
 */
public final class Location extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.talent.v4beta1.Location)
    LocationOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use Location.newBuilder() to construct.
  private Location(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private Location() {
    locationType_ = 0;
  }

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

  private Location(
      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 8:
            {
              int rawValue = input.readEnum();

              locationType_ = rawValue;
              break;
            }
          case 18:
            {
              com.google.type.PostalAddress.Builder subBuilder = null;
              if (postalAddress_ != null) {
                subBuilder = postalAddress_.toBuilder();
              }
              postalAddress_ =
                  input.readMessage(com.google.type.PostalAddress.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(postalAddress_);
                postalAddress_ = subBuilder.buildPartial();
              }

              break;
            }
          case 26:
            {
              com.google.type.LatLng.Builder subBuilder = null;
              if (latLng_ != null) {
                subBuilder = latLng_.toBuilder();
              }
              latLng_ = input.readMessage(com.google.type.LatLng.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(latLng_);
                latLng_ = subBuilder.buildPartial();
              }

              break;
            }
          case 33:
            {
              radiusMiles_ = input.readDouble();
              break;
            }
          default:
            {
              if (!parseUnknownField(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 {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.talent.v4beta1.CommonProto
        .internal_static_google_cloud_talent_v4beta1_Location_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.talent.v4beta1.CommonProto
        .internal_static_google_cloud_talent_v4beta1_Location_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.talent.v4beta1.Location.class,
            com.google.cloud.talent.v4beta1.Location.Builder.class);
  }

  /**
   *
   *
   * <pre>
   * An enum which represents the type of a location.
   * </pre>
   *
   * Protobuf enum {@code google.cloud.talent.v4beta1.Location.LocationType}
   */
  public enum LocationType implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *
     *
     * <pre>
     * Default value if the type isn't specified.
     * </pre>
     *
     * <code>LOCATION_TYPE_UNSPECIFIED = 0;</code>
     */
    LOCATION_TYPE_UNSPECIFIED(0),
    /**
     *
     *
     * <pre>
     * A country level location.
     * </pre>
     *
     * <code>COUNTRY = 1;</code>
     */
    COUNTRY(1),
    /**
     *
     *
     * <pre>
     * A state or equivalent level location.
     * </pre>
     *
     * <code>ADMINISTRATIVE_AREA = 2;</code>
     */
    ADMINISTRATIVE_AREA(2),
    /**
     *
     *
     * <pre>
     * A county or equivalent level location.
     * </pre>
     *
     * <code>SUB_ADMINISTRATIVE_AREA = 3;</code>
     */
    SUB_ADMINISTRATIVE_AREA(3),
    /**
     *
     *
     * <pre>
     * A city or equivalent level location.
     * </pre>
     *
     * <code>LOCALITY = 4;</code>
     */
    LOCALITY(4),
    /**
     *
     *
     * <pre>
     * A postal code level location.
     * </pre>
     *
     * <code>POSTAL_CODE = 5;</code>
     */
    POSTAL_CODE(5),
    /**
     *
     *
     * <pre>
     * A sublocality is a subdivision of a locality, for example a city borough,
     * ward, or arrondissement. Sublocalities are usually recognized by a local
     * political authority. For example, Manhattan and Brooklyn are recognized
     * as boroughs by the City of New York, and are therefore modeled as
     * sublocalities.
     * </pre>
     *
     * <code>SUB_LOCALITY = 6;</code>
     */
    SUB_LOCALITY(6),
    /**
     *
     *
     * <pre>
     * A district or equivalent level location.
     * </pre>
     *
     * <code>SUB_LOCALITY_1 = 7;</code>
     */
    SUB_LOCALITY_1(7),
    /**
     *
     *
     * <pre>
     * A smaller district or equivalent level display.
     * </pre>
     *
     * <code>SUB_LOCALITY_2 = 8;</code>
     */
    SUB_LOCALITY_2(8),
    /**
     *
     *
     * <pre>
     * A neighborhood level location.
     * </pre>
     *
     * <code>NEIGHBORHOOD = 9;</code>
     */
    NEIGHBORHOOD(9),
    /**
     *
     *
     * <pre>
     * A street address level location.
     * </pre>
     *
     * <code>STREET_ADDRESS = 10;</code>
     */
    STREET_ADDRESS(10),
    UNRECOGNIZED(-1),
    ;

    /**
     *
     *
     * <pre>
     * Default value if the type isn't specified.
     * </pre>
     *
     * <code>LOCATION_TYPE_UNSPECIFIED = 0;</code>
     */
    public static final int LOCATION_TYPE_UNSPECIFIED_VALUE = 0;
    /**
     *
     *
     * <pre>
     * A country level location.
     * </pre>
     *
     * <code>COUNTRY = 1;</code>
     */
    public static final int COUNTRY_VALUE = 1;
    /**
     *
     *
     * <pre>
     * A state or equivalent level location.
     * </pre>
     *
     * <code>ADMINISTRATIVE_AREA = 2;</code>
     */
    public static final int ADMINISTRATIVE_AREA_VALUE = 2;
    /**
     *
     *
     * <pre>
     * A county or equivalent level location.
     * </pre>
     *
     * <code>SUB_ADMINISTRATIVE_AREA = 3;</code>
     */
    public static final int SUB_ADMINISTRATIVE_AREA_VALUE = 3;
    /**
     *
     *
     * <pre>
     * A city or equivalent level location.
     * </pre>
     *
     * <code>LOCALITY = 4;</code>
     */
    public static final int LOCALITY_VALUE = 4;
    /**
     *
     *
     * <pre>
     * A postal code level location.
     * </pre>
     *
     * <code>POSTAL_CODE = 5;</code>
     */
    public static final int POSTAL_CODE_VALUE = 5;
    /**
     *
     *
     * <pre>
     * A sublocality is a subdivision of a locality, for example a city borough,
     * ward, or arrondissement. Sublocalities are usually recognized by a local
     * political authority. For example, Manhattan and Brooklyn are recognized
     * as boroughs by the City of New York, and are therefore modeled as
     * sublocalities.
     * </pre>
     *
     * <code>SUB_LOCALITY = 6;</code>
     */
    public static final int SUB_LOCALITY_VALUE = 6;
    /**
     *
     *
     * <pre>
     * A district or equivalent level location.
     * </pre>
     *
     * <code>SUB_LOCALITY_1 = 7;</code>
     */
    public static final int SUB_LOCALITY_1_VALUE = 7;
    /**
     *
     *
     * <pre>
     * A smaller district or equivalent level display.
     * </pre>
     *
     * <code>SUB_LOCALITY_2 = 8;</code>
     */
    public static final int SUB_LOCALITY_2_VALUE = 8;
    /**
     *
     *
     * <pre>
     * A neighborhood level location.
     * </pre>
     *
     * <code>NEIGHBORHOOD = 9;</code>
     */
    public static final int NEIGHBORHOOD_VALUE = 9;
    /**
     *
     *
     * <pre>
     * A street address level location.
     * </pre>
     *
     * <code>STREET_ADDRESS = 10;</code>
     */
    public static final int STREET_ADDRESS_VALUE = 10;

    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /** @deprecated Use {@link #forNumber(int)} instead. */
    @java.lang.Deprecated
    public static LocationType valueOf(int value) {
      return forNumber(value);
    }

    public static LocationType forNumber(int value) {
      switch (value) {
        case 0:
          return LOCATION_TYPE_UNSPECIFIED;
        case 1:
          return COUNTRY;
        case 2:
          return ADMINISTRATIVE_AREA;
        case 3:
          return SUB_ADMINISTRATIVE_AREA;
        case 4:
          return LOCALITY;
        case 5:
          return POSTAL_CODE;
        case 6:
          return SUB_LOCALITY;
        case 7:
          return SUB_LOCALITY_1;
        case 8:
          return SUB_LOCALITY_2;
        case 9:
          return NEIGHBORHOOD;
        case 10:
          return STREET_ADDRESS;
        default:
          return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<LocationType> internalGetValueMap() {
      return internalValueMap;
    }

    private static final com.google.protobuf.Internal.EnumLiteMap<LocationType> internalValueMap =
        new com.google.protobuf.Internal.EnumLiteMap<LocationType>() {
          public LocationType findValueByNumber(int number) {
            return LocationType.forNumber(number);
          }
        };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
      return getDescriptor().getValues().get(ordinal());
    }

    public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
      return getDescriptor();
    }

    public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
      return com.google.cloud.talent.v4beta1.Location.getDescriptor().getEnumTypes().get(0);
    }

    private static final LocationType[] VALUES = values();

    public static LocationType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
      }
      if (desc.getIndex() == -1) {
        return UNRECOGNIZED;
      }
      return VALUES[desc.getIndex()];
    }

    private final int value;

    private LocationType(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.cloud.talent.v4beta1.Location.LocationType)
  }

  public static final int LOCATION_TYPE_FIELD_NUMBER = 1;
  private int locationType_;
  /**
   *
   *
   * <pre>
   * The type of a location, which corresponds to the address lines field of
   * [PostalAddress][]. For example, "Downtown, Atlanta, GA, USA" has a type of
   * [LocationType#NEIGHBORHOOD][], and "Kansas City, KS, USA" has a type of
   * [LocationType#LOCALITY][].
   * </pre>
   *
   * <code>.google.cloud.talent.v4beta1.Location.LocationType location_type = 1;</code>
   */
  public int getLocationTypeValue() {
    return locationType_;
  }
  /**
   *
   *
   * <pre>
   * The type of a location, which corresponds to the address lines field of
   * [PostalAddress][]. For example, "Downtown, Atlanta, GA, USA" has a type of
   * [LocationType#NEIGHBORHOOD][], and "Kansas City, KS, USA" has a type of
   * [LocationType#LOCALITY][].
   * </pre>
   *
   * <code>.google.cloud.talent.v4beta1.Location.LocationType location_type = 1;</code>
   */
  public com.google.cloud.talent.v4beta1.Location.LocationType getLocationType() {
    @SuppressWarnings("deprecation")
    com.google.cloud.talent.v4beta1.Location.LocationType result =
        com.google.cloud.talent.v4beta1.Location.LocationType.valueOf(locationType_);
    return result == null
        ? com.google.cloud.talent.v4beta1.Location.LocationType.UNRECOGNIZED
        : result;
  }

  public static final int POSTAL_ADDRESS_FIELD_NUMBER = 2;
  private com.google.type.PostalAddress postalAddress_;
  /**
   *
   *
   * <pre>
   * Postal address of the location that includes human readable information,
   * such as postal delivery and payments addresses. Given a postal address,
   * a postal service can deliver items to a premises, P.O. Box, or other
   * delivery location.
   * </pre>
   *
   * <code>.google.type.PostalAddress postal_address = 2;</code>
   */
  public boolean hasPostalAddress() {
    return postalAddress_ != null;
  }
  /**
   *
   *
   * <pre>
   * Postal address of the location that includes human readable information,
   * such as postal delivery and payments addresses. Given a postal address,
   * a postal service can deliver items to a premises, P.O. Box, or other
   * delivery location.
   * </pre>
   *
   * <code>.google.type.PostalAddress postal_address = 2;</code>
   */
  public com.google.type.PostalAddress getPostalAddress() {
    return postalAddress_ == null
        ? com.google.type.PostalAddress.getDefaultInstance()
        : postalAddress_;
  }
  /**
   *
   *
   * <pre>
   * Postal address of the location that includes human readable information,
   * such as postal delivery and payments addresses. Given a postal address,
   * a postal service can deliver items to a premises, P.O. Box, or other
   * delivery location.
   * </pre>
   *
   * <code>.google.type.PostalAddress postal_address = 2;</code>
   */
  public com.google.type.PostalAddressOrBuilder getPostalAddressOrBuilder() {
    return getPostalAddress();
  }

  public static final int LAT_LNG_FIELD_NUMBER = 3;
  private com.google.type.LatLng latLng_;
  /**
   *
   *
   * <pre>
   * An object representing a latitude/longitude pair.
   * </pre>
   *
   * <code>.google.type.LatLng lat_lng = 3;</code>
   */
  public boolean hasLatLng() {
    return latLng_ != null;
  }
  /**
   *
   *
   * <pre>
   * An object representing a latitude/longitude pair.
   * </pre>
   *
   * <code>.google.type.LatLng lat_lng = 3;</code>
   */
  public com.google.type.LatLng getLatLng() {
    return latLng_ == null ? com.google.type.LatLng.getDefaultInstance() : latLng_;
  }
  /**
   *
   *
   * <pre>
   * An object representing a latitude/longitude pair.
   * </pre>
   *
   * <code>.google.type.LatLng lat_lng = 3;</code>
   */
  public com.google.type.LatLngOrBuilder getLatLngOrBuilder() {
    return getLatLng();
  }

  public static final int RADIUS_MILES_FIELD_NUMBER = 4;
  private double radiusMiles_;
  /**
   *
   *
   * <pre>
   * Radius in miles of the job location. This value is derived from the
   * location bounding box in which a circle with the specified radius
   * centered from [LatLng][] covers the area associated with the job location.
   * For example, currently, "Mountain View, CA, USA" has a radius of
   * 6.17 miles.
   * </pre>
   *
   * <code>double radius_miles = 4;</code>
   */
  public double getRadiusMiles() {
    return radiusMiles_;
  }

  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 (locationType_
        != com.google.cloud.talent.v4beta1.Location.LocationType.LOCATION_TYPE_UNSPECIFIED
            .getNumber()) {
      output.writeEnum(1, locationType_);
    }
    if (postalAddress_ != null) {
      output.writeMessage(2, getPostalAddress());
    }
    if (latLng_ != null) {
      output.writeMessage(3, getLatLng());
    }
    if (radiusMiles_ != 0D) {
      output.writeDouble(4, radiusMiles_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (locationType_
        != com.google.cloud.talent.v4beta1.Location.LocationType.LOCATION_TYPE_UNSPECIFIED
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, locationType_);
    }
    if (postalAddress_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPostalAddress());
    }
    if (latLng_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getLatLng());
    }
    if (radiusMiles_ != 0D) {
      size += com.google.protobuf.CodedOutputStream.computeDoubleSize(4, radiusMiles_);
    }
    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.talent.v4beta1.Location)) {
      return super.equals(obj);
    }
    com.google.cloud.talent.v4beta1.Location other = (com.google.cloud.talent.v4beta1.Location) obj;

    if (locationType_ != other.locationType_) return false;
    if (hasPostalAddress() != other.hasPostalAddress()) return false;
    if (hasPostalAddress()) {
      if (!getPostalAddress().equals(other.getPostalAddress())) return false;
    }
    if (hasLatLng() != other.hasLatLng()) return false;
    if (hasLatLng()) {
      if (!getLatLng().equals(other.getLatLng())) return false;
    }
    if (java.lang.Double.doubleToLongBits(getRadiusMiles())
        != java.lang.Double.doubleToLongBits(other.getRadiusMiles())) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + LOCATION_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + locationType_;
    if (hasPostalAddress()) {
      hash = (37 * hash) + POSTAL_ADDRESS_FIELD_NUMBER;
      hash = (53 * hash) + getPostalAddress().hashCode();
    }
    if (hasLatLng()) {
      hash = (37 * hash) + LAT_LNG_FIELD_NUMBER;
      hash = (53 * hash) + getLatLng().hashCode();
    }
    hash = (37 * hash) + RADIUS_MILES_FIELD_NUMBER;
    hash =
        (53 * hash)
            + com.google.protobuf.Internal.hashLong(
                java.lang.Double.doubleToLongBits(getRadiusMiles()));
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.talent.v4beta1.Location parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.talent.v4beta1.Location 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.talent.v4beta1.Location parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.talent.v4beta1.Location 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.talent.v4beta1.Location parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

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

  public static com.google.cloud.talent.v4beta1.Location 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.talent.v4beta1.Location parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.talent.v4beta1.Location 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.talent.v4beta1.Location parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.talent.v4beta1.Location 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.talent.v4beta1.Location 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>
   * Output only. A resource that represents a location with full geographic
   * information.
   * </pre>
   *
   * Protobuf type {@code google.cloud.talent.v4beta1.Location}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.talent.v4beta1.Location)
      com.google.cloud.talent.v4beta1.LocationOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.talent.v4beta1.CommonProto
          .internal_static_google_cloud_talent_v4beta1_Location_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.talent.v4beta1.CommonProto
          .internal_static_google_cloud_talent_v4beta1_Location_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.talent.v4beta1.Location.class,
              com.google.cloud.talent.v4beta1.Location.Builder.class);
    }

    // Construct using com.google.cloud.talent.v4beta1.Location.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

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

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      locationType_ = 0;

      if (postalAddressBuilder_ == null) {
        postalAddress_ = null;
      } else {
        postalAddress_ = null;
        postalAddressBuilder_ = null;
      }
      if (latLngBuilder_ == null) {
        latLng_ = null;
      } else {
        latLng_ = null;
        latLngBuilder_ = null;
      }
      radiusMiles_ = 0D;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.talent.v4beta1.CommonProto
          .internal_static_google_cloud_talent_v4beta1_Location_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.talent.v4beta1.Location getDefaultInstanceForType() {
      return com.google.cloud.talent.v4beta1.Location.getDefaultInstance();
    }

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

    @java.lang.Override
    public com.google.cloud.talent.v4beta1.Location buildPartial() {
      com.google.cloud.talent.v4beta1.Location result =
          new com.google.cloud.talent.v4beta1.Location(this);
      result.locationType_ = locationType_;
      if (postalAddressBuilder_ == null) {
        result.postalAddress_ = postalAddress_;
      } else {
        result.postalAddress_ = postalAddressBuilder_.build();
      }
      if (latLngBuilder_ == null) {
        result.latLng_ = latLng_;
      } else {
        result.latLng_ = latLngBuilder_.build();
      }
      result.radiusMiles_ = radiusMiles_;
      onBuilt();
      return result;
    }

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

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

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

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

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

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

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

    public Builder mergeFrom(com.google.cloud.talent.v4beta1.Location other) {
      if (other == com.google.cloud.talent.v4beta1.Location.getDefaultInstance()) return this;
      if (other.locationType_ != 0) {
        setLocationTypeValue(other.getLocationTypeValue());
      }
      if (other.hasPostalAddress()) {
        mergePostalAddress(other.getPostalAddress());
      }
      if (other.hasLatLng()) {
        mergeLatLng(other.getLatLng());
      }
      if (other.getRadiusMiles() != 0D) {
        setRadiusMiles(other.getRadiusMiles());
      }
      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.talent.v4beta1.Location parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.talent.v4beta1.Location) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int locationType_ = 0;
    /**
     *
     *
     * <pre>
     * The type of a location, which corresponds to the address lines field of
     * [PostalAddress][]. For example, "Downtown, Atlanta, GA, USA" has a type of
     * [LocationType#NEIGHBORHOOD][], and "Kansas City, KS, USA" has a type of
     * [LocationType#LOCALITY][].
     * </pre>
     *
     * <code>.google.cloud.talent.v4beta1.Location.LocationType location_type = 1;</code>
     */
    public int getLocationTypeValue() {
      return locationType_;
    }
    /**
     *
     *
     * <pre>
     * The type of a location, which corresponds to the address lines field of
     * [PostalAddress][]. For example, "Downtown, Atlanta, GA, USA" has a type of
     * [LocationType#NEIGHBORHOOD][], and "Kansas City, KS, USA" has a type of
     * [LocationType#LOCALITY][].
     * </pre>
     *
     * <code>.google.cloud.talent.v4beta1.Location.LocationType location_type = 1;</code>
     */
    public Builder setLocationTypeValue(int value) {
      locationType_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The type of a location, which corresponds to the address lines field of
     * [PostalAddress][]. For example, "Downtown, Atlanta, GA, USA" has a type of
     * [LocationType#NEIGHBORHOOD][], and "Kansas City, KS, USA" has a type of
     * [LocationType#LOCALITY][].
     * </pre>
     *
     * <code>.google.cloud.talent.v4beta1.Location.LocationType location_type = 1;</code>
     */
    public com.google.cloud.talent.v4beta1.Location.LocationType getLocationType() {
      @SuppressWarnings("deprecation")
      com.google.cloud.talent.v4beta1.Location.LocationType result =
          com.google.cloud.talent.v4beta1.Location.LocationType.valueOf(locationType_);
      return result == null
          ? com.google.cloud.talent.v4beta1.Location.LocationType.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * The type of a location, which corresponds to the address lines field of
     * [PostalAddress][]. For example, "Downtown, Atlanta, GA, USA" has a type of
     * [LocationType#NEIGHBORHOOD][], and "Kansas City, KS, USA" has a type of
     * [LocationType#LOCALITY][].
     * </pre>
     *
     * <code>.google.cloud.talent.v4beta1.Location.LocationType location_type = 1;</code>
     */
    public Builder setLocationType(com.google.cloud.talent.v4beta1.Location.LocationType value) {
      if (value == null) {
        throw new NullPointerException();
      }

      locationType_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The type of a location, which corresponds to the address lines field of
     * [PostalAddress][]. For example, "Downtown, Atlanta, GA, USA" has a type of
     * [LocationType#NEIGHBORHOOD][], and "Kansas City, KS, USA" has a type of
     * [LocationType#LOCALITY][].
     * </pre>
     *
     * <code>.google.cloud.talent.v4beta1.Location.LocationType location_type = 1;</code>
     */
    public Builder clearLocationType() {

      locationType_ = 0;
      onChanged();
      return this;
    }

    private com.google.type.PostalAddress postalAddress_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.type.PostalAddress,
            com.google.type.PostalAddress.Builder,
            com.google.type.PostalAddressOrBuilder>
        postalAddressBuilder_;
    /**
     *
     *
     * <pre>
     * Postal address of the location that includes human readable information,
     * such as postal delivery and payments addresses. Given a postal address,
     * a postal service can deliver items to a premises, P.O. Box, or other
     * delivery location.
     * </pre>
     *
     * <code>.google.type.PostalAddress postal_address = 2;</code>
     */
    public boolean hasPostalAddress() {
      return postalAddressBuilder_ != null || postalAddress_ != null;
    }
    /**
     *
     *
     * <pre>
     * Postal address of the location that includes human readable information,
     * such as postal delivery and payments addresses. Given a postal address,
     * a postal service can deliver items to a premises, P.O. Box, or other
     * delivery location.
     * </pre>
     *
     * <code>.google.type.PostalAddress postal_address = 2;</code>
     */
    public com.google.type.PostalAddress getPostalAddress() {
      if (postalAddressBuilder_ == null) {
        return postalAddress_ == null
            ? com.google.type.PostalAddress.getDefaultInstance()
            : postalAddress_;
      } else {
        return postalAddressBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Postal address of the location that includes human readable information,
     * such as postal delivery and payments addresses. Given a postal address,
     * a postal service can deliver items to a premises, P.O. Box, or other
     * delivery location.
     * </pre>
     *
     * <code>.google.type.PostalAddress postal_address = 2;</code>
     */
    public Builder setPostalAddress(com.google.type.PostalAddress value) {
      if (postalAddressBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        postalAddress_ = value;
        onChanged();
      } else {
        postalAddressBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Postal address of the location that includes human readable information,
     * such as postal delivery and payments addresses. Given a postal address,
     * a postal service can deliver items to a premises, P.O. Box, or other
     * delivery location.
     * </pre>
     *
     * <code>.google.type.PostalAddress postal_address = 2;</code>
     */
    public Builder setPostalAddress(com.google.type.PostalAddress.Builder builderForValue) {
      if (postalAddressBuilder_ == null) {
        postalAddress_ = builderForValue.build();
        onChanged();
      } else {
        postalAddressBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Postal address of the location that includes human readable information,
     * such as postal delivery and payments addresses. Given a postal address,
     * a postal service can deliver items to a premises, P.O. Box, or other
     * delivery location.
     * </pre>
     *
     * <code>.google.type.PostalAddress postal_address = 2;</code>
     */
    public Builder mergePostalAddress(com.google.type.PostalAddress value) {
      if (postalAddressBuilder_ == null) {
        if (postalAddress_ != null) {
          postalAddress_ =
              com.google.type.PostalAddress.newBuilder(postalAddress_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          postalAddress_ = value;
        }
        onChanged();
      } else {
        postalAddressBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Postal address of the location that includes human readable information,
     * such as postal delivery and payments addresses. Given a postal address,
     * a postal service can deliver items to a premises, P.O. Box, or other
     * delivery location.
     * </pre>
     *
     * <code>.google.type.PostalAddress postal_address = 2;</code>
     */
    public Builder clearPostalAddress() {
      if (postalAddressBuilder_ == null) {
        postalAddress_ = null;
        onChanged();
      } else {
        postalAddress_ = null;
        postalAddressBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Postal address of the location that includes human readable information,
     * such as postal delivery and payments addresses. Given a postal address,
     * a postal service can deliver items to a premises, P.O. Box, or other
     * delivery location.
     * </pre>
     *
     * <code>.google.type.PostalAddress postal_address = 2;</code>
     */
    public com.google.type.PostalAddress.Builder getPostalAddressBuilder() {

      onChanged();
      return getPostalAddressFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Postal address of the location that includes human readable information,
     * such as postal delivery and payments addresses. Given a postal address,
     * a postal service can deliver items to a premises, P.O. Box, or other
     * delivery location.
     * </pre>
     *
     * <code>.google.type.PostalAddress postal_address = 2;</code>
     */
    public com.google.type.PostalAddressOrBuilder getPostalAddressOrBuilder() {
      if (postalAddressBuilder_ != null) {
        return postalAddressBuilder_.getMessageOrBuilder();
      } else {
        return postalAddress_ == null
            ? com.google.type.PostalAddress.getDefaultInstance()
            : postalAddress_;
      }
    }
    /**
     *
     *
     * <pre>
     * Postal address of the location that includes human readable information,
     * such as postal delivery and payments addresses. Given a postal address,
     * a postal service can deliver items to a premises, P.O. Box, or other
     * delivery location.
     * </pre>
     *
     * <code>.google.type.PostalAddress postal_address = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.type.PostalAddress,
            com.google.type.PostalAddress.Builder,
            com.google.type.PostalAddressOrBuilder>
        getPostalAddressFieldBuilder() {
      if (postalAddressBuilder_ == null) {
        postalAddressBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.type.PostalAddress,
                com.google.type.PostalAddress.Builder,
                com.google.type.PostalAddressOrBuilder>(
                getPostalAddress(), getParentForChildren(), isClean());
        postalAddress_ = null;
      }
      return postalAddressBuilder_;
    }

    private com.google.type.LatLng latLng_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder>
        latLngBuilder_;
    /**
     *
     *
     * <pre>
     * An object representing a latitude/longitude pair.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public boolean hasLatLng() {
      return latLngBuilder_ != null || latLng_ != null;
    }
    /**
     *
     *
     * <pre>
     * An object representing a latitude/longitude pair.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public com.google.type.LatLng getLatLng() {
      if (latLngBuilder_ == null) {
        return latLng_ == null ? com.google.type.LatLng.getDefaultInstance() : latLng_;
      } else {
        return latLngBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * An object representing a latitude/longitude pair.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public Builder setLatLng(com.google.type.LatLng value) {
      if (latLngBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        latLng_ = value;
        onChanged();
      } else {
        latLngBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * An object representing a latitude/longitude pair.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public Builder setLatLng(com.google.type.LatLng.Builder builderForValue) {
      if (latLngBuilder_ == null) {
        latLng_ = builderForValue.build();
        onChanged();
      } else {
        latLngBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * An object representing a latitude/longitude pair.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public Builder mergeLatLng(com.google.type.LatLng value) {
      if (latLngBuilder_ == null) {
        if (latLng_ != null) {
          latLng_ = com.google.type.LatLng.newBuilder(latLng_).mergeFrom(value).buildPartial();
        } else {
          latLng_ = value;
        }
        onChanged();
      } else {
        latLngBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * An object representing a latitude/longitude pair.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public Builder clearLatLng() {
      if (latLngBuilder_ == null) {
        latLng_ = null;
        onChanged();
      } else {
        latLng_ = null;
        latLngBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * An object representing a latitude/longitude pair.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public com.google.type.LatLng.Builder getLatLngBuilder() {

      onChanged();
      return getLatLngFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * An object representing a latitude/longitude pair.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    public com.google.type.LatLngOrBuilder getLatLngOrBuilder() {
      if (latLngBuilder_ != null) {
        return latLngBuilder_.getMessageOrBuilder();
      } else {
        return latLng_ == null ? com.google.type.LatLng.getDefaultInstance() : latLng_;
      }
    }
    /**
     *
     *
     * <pre>
     * An object representing a latitude/longitude pair.
     * </pre>
     *
     * <code>.google.type.LatLng lat_lng = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder>
        getLatLngFieldBuilder() {
      if (latLngBuilder_ == null) {
        latLngBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.type.LatLng,
                com.google.type.LatLng.Builder,
                com.google.type.LatLngOrBuilder>(getLatLng(), getParentForChildren(), isClean());
        latLng_ = null;
      }
      return latLngBuilder_;
    }

    private double radiusMiles_;
    /**
     *
     *
     * <pre>
     * Radius in miles of the job location. This value is derived from the
     * location bounding box in which a circle with the specified radius
     * centered from [LatLng][] covers the area associated with the job location.
     * For example, currently, "Mountain View, CA, USA" has a radius of
     * 6.17 miles.
     * </pre>
     *
     * <code>double radius_miles = 4;</code>
     */
    public double getRadiusMiles() {
      return radiusMiles_;
    }
    /**
     *
     *
     * <pre>
     * Radius in miles of the job location. This value is derived from the
     * location bounding box in which a circle with the specified radius
     * centered from [LatLng][] covers the area associated with the job location.
     * For example, currently, "Mountain View, CA, USA" has a radius of
     * 6.17 miles.
     * </pre>
     *
     * <code>double radius_miles = 4;</code>
     */
    public Builder setRadiusMiles(double value) {

      radiusMiles_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Radius in miles of the job location. This value is derived from the
     * location bounding box in which a circle with the specified radius
     * centered from [LatLng][] covers the area associated with the job location.
     * For example, currently, "Mountain View, CA, USA" has a radius of
     * 6.17 miles.
     * </pre>
     *
     * <code>double radius_miles = 4;</code>
     */
    public Builder clearRadiusMiles() {

      radiusMiles_ = 0D;
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(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.talent.v4beta1.Location)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Location)
  private static final com.google.cloud.talent.v4beta1.Location DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.talent.v4beta1.Location();
  }

  public static com.google.cloud.talent.v4beta1.Location getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public com.google.cloud.talent.v4beta1.Location getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
