/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/essentialcontacts/v1/service.proto

package com.google.cloud.essentialcontacts.v1;

/**
 *
 *
 * <pre>
 * A contact that will receive notifications from Google Cloud.
 * </pre>
 *
 * Protobuf type {@code google.cloud.essentialcontacts.v1.Contact}
 */
public final class Contact extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.essentialcontacts.v1.Contact)
    ContactOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use Contact.newBuilder() to construct.
  private Contact(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private Contact() {
    name_ = "";
    email_ = "";
    notificationCategorySubscriptions_ = java.util.Collections.emptyList();
    languageTag_ = "";
    validationState_ = 0;
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new Contact();
  }

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

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.essentialcontacts.v1.Service
        .internal_static_google_cloud_essentialcontacts_v1_Contact_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.essentialcontacts.v1.Service
        .internal_static_google_cloud_essentialcontacts_v1_Contact_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.essentialcontacts.v1.Contact.class,
            com.google.cloud.essentialcontacts.v1.Contact.Builder.class);
  }

  public static final int NAME_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object name_ = "";
  /**
   *
   *
   * <pre>
   * The identifier for the contact.
   * Format: {resource_type}/{resource_id}/contacts/{contact_id}
   * </pre>
   *
   * <code>string name = 1;</code>
   *
   * @return The name.
   */
  @java.lang.Override
  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 identifier for the contact.
   * Format: {resource_type}/{resource_id}/contacts/{contact_id}
   * </pre>
   *
   * <code>string name = 1;</code>
   *
   * @return The bytes for name.
   */
  @java.lang.Override
  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 EMAIL_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object email_ = "";
  /**
   *
   *
   * <pre>
   * Required. The email address to send notifications to. This does not need to
   * be a Google account.
   * </pre>
   *
   * <code>string email = 2;</code>
   *
   * @return The email.
   */
  @java.lang.Override
  public java.lang.String getEmail() {
    java.lang.Object ref = email_;
    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();
      email_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required. The email address to send notifications to. This does not need to
   * be a Google account.
   * </pre>
   *
   * <code>string email = 2;</code>
   *
   * @return The bytes for email.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getEmailBytes() {
    java.lang.Object ref = email_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      email_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int NOTIFICATION_CATEGORY_SUBSCRIPTIONS_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private java.util.List<java.lang.Integer> notificationCategorySubscriptions_;

  private static final com.google.protobuf.Internal.ListAdapter.Converter<
          java.lang.Integer, com.google.cloud.essentialcontacts.v1.NotificationCategory>
      notificationCategorySubscriptions_converter_ =
          new com.google.protobuf.Internal.ListAdapter.Converter<
              java.lang.Integer, com.google.cloud.essentialcontacts.v1.NotificationCategory>() {
            public com.google.cloud.essentialcontacts.v1.NotificationCategory convert(
                java.lang.Integer from) {
              com.google.cloud.essentialcontacts.v1.NotificationCategory result =
                  com.google.cloud.essentialcontacts.v1.NotificationCategory.forNumber(from);
              return result == null
                  ? com.google.cloud.essentialcontacts.v1.NotificationCategory.UNRECOGNIZED
                  : result;
            }
          };
  /**
   *
   *
   * <pre>
   * The categories of notifications that the contact will receive
   * communications for.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
   * </code>
   *
   * @return A list containing the notificationCategorySubscriptions.
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.essentialcontacts.v1.NotificationCategory>
      getNotificationCategorySubscriptionsList() {
    return new com.google.protobuf.Internal.ListAdapter<
        java.lang.Integer, com.google.cloud.essentialcontacts.v1.NotificationCategory>(
        notificationCategorySubscriptions_, notificationCategorySubscriptions_converter_);
  }
  /**
   *
   *
   * <pre>
   * The categories of notifications that the contact will receive
   * communications for.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
   * </code>
   *
   * @return The count of notificationCategorySubscriptions.
   */
  @java.lang.Override
  public int getNotificationCategorySubscriptionsCount() {
    return notificationCategorySubscriptions_.size();
  }
  /**
   *
   *
   * <pre>
   * The categories of notifications that the contact will receive
   * communications for.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
   * </code>
   *
   * @param index The index of the element to return.
   * @return The notificationCategorySubscriptions at the given index.
   */
  @java.lang.Override
  public com.google.cloud.essentialcontacts.v1.NotificationCategory
      getNotificationCategorySubscriptions(int index) {
    return notificationCategorySubscriptions_converter_.convert(
        notificationCategorySubscriptions_.get(index));
  }
  /**
   *
   *
   * <pre>
   * The categories of notifications that the contact will receive
   * communications for.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
   * </code>
   *
   * @return A list containing the enum numeric values on the wire for
   *     notificationCategorySubscriptions.
   */
  @java.lang.Override
  public java.util.List<java.lang.Integer> getNotificationCategorySubscriptionsValueList() {
    return notificationCategorySubscriptions_;
  }
  /**
   *
   *
   * <pre>
   * The categories of notifications that the contact will receive
   * communications for.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
   * </code>
   *
   * @param index The index of the value to return.
   * @return The enum numeric value on the wire of notificationCategorySubscriptions at the given
   *     index.
   */
  @java.lang.Override
  public int getNotificationCategorySubscriptionsValue(int index) {
    return notificationCategorySubscriptions_.get(index);
  }

  private int notificationCategorySubscriptionsMemoizedSerializedSize;

  public static final int LANGUAGE_TAG_FIELD_NUMBER = 4;

  @SuppressWarnings("serial")
  private volatile java.lang.Object languageTag_ = "";
  /**
   *
   *
   * <pre>
   * The preferred language for notifications, as a ISO 639-1 language code. See
   * [Supported
   * languages](https://cloud.google.com/resource-manager/docs/managing-notification-contacts#supported-languages)
   * for a list of supported languages.
   * </pre>
   *
   * <code>string language_tag = 4;</code>
   *
   * @return The languageTag.
   */
  @java.lang.Override
  public java.lang.String getLanguageTag() {
    java.lang.Object ref = languageTag_;
    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();
      languageTag_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The preferred language for notifications, as a ISO 639-1 language code. See
   * [Supported
   * languages](https://cloud.google.com/resource-manager/docs/managing-notification-contacts#supported-languages)
   * for a list of supported languages.
   * </pre>
   *
   * <code>string language_tag = 4;</code>
   *
   * @return The bytes for languageTag.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getLanguageTagBytes() {
    java.lang.Object ref = languageTag_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      languageTag_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int VALIDATION_STATE_FIELD_NUMBER = 8;
  private int validationState_ = 0;
  /**
   *
   *
   * <pre>
   * The validity of the contact. A contact is considered valid if it is the
   * correct recipient for notifications for a particular resource.
   * </pre>
   *
   * <code>.google.cloud.essentialcontacts.v1.ValidationState validation_state = 8;</code>
   *
   * @return The enum numeric value on the wire for validationState.
   */
  @java.lang.Override
  public int getValidationStateValue() {
    return validationState_;
  }
  /**
   *
   *
   * <pre>
   * The validity of the contact. A contact is considered valid if it is the
   * correct recipient for notifications for a particular resource.
   * </pre>
   *
   * <code>.google.cloud.essentialcontacts.v1.ValidationState validation_state = 8;</code>
   *
   * @return The validationState.
   */
  @java.lang.Override
  public com.google.cloud.essentialcontacts.v1.ValidationState getValidationState() {
    com.google.cloud.essentialcontacts.v1.ValidationState result =
        com.google.cloud.essentialcontacts.v1.ValidationState.forNumber(validationState_);
    return result == null
        ? com.google.cloud.essentialcontacts.v1.ValidationState.UNRECOGNIZED
        : result;
  }

  public static final int VALIDATE_TIME_FIELD_NUMBER = 9;
  private com.google.protobuf.Timestamp validateTime_;
  /**
   *
   *
   * <pre>
   * The last time the validation_state was updated, either manually or
   * automatically. A contact is considered stale if its validation state was
   * updated more than 1 year ago.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp validate_time = 9;</code>
   *
   * @return Whether the validateTime field is set.
   */
  @java.lang.Override
  public boolean hasValidateTime() {
    return validateTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * The last time the validation_state was updated, either manually or
   * automatically. A contact is considered stale if its validation state was
   * updated more than 1 year ago.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp validate_time = 9;</code>
   *
   * @return The validateTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getValidateTime() {
    return validateTime_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : validateTime_;
  }
  /**
   *
   *
   * <pre>
   * The last time the validation_state was updated, either manually or
   * automatically. A contact is considered stale if its validation state was
   * updated more than 1 year ago.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp validate_time = 9;</code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getValidateTimeOrBuilder() {
    return validateTime_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : validateTime_;
  }

  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 {
    getSerializedSize();
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, email_);
    }
    if (getNotificationCategorySubscriptionsList().size() > 0) {
      output.writeUInt32NoTag(26);
      output.writeUInt32NoTag(notificationCategorySubscriptionsMemoizedSerializedSize);
    }
    for (int i = 0; i < notificationCategorySubscriptions_.size(); i++) {
      output.writeEnumNoTag(notificationCategorySubscriptions_.get(i));
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageTag_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, languageTag_);
    }
    if (validationState_
        != com.google.cloud.essentialcontacts.v1.ValidationState.VALIDATION_STATE_UNSPECIFIED
            .getNumber()) {
      output.writeEnum(8, validationState_);
    }
    if (validateTime_ != null) {
      output.writeMessage(9, getValidateTime());
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(email_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, email_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < notificationCategorySubscriptions_.size(); i++) {
        dataSize +=
            com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(
                notificationCategorySubscriptions_.get(i));
      }
      size += dataSize;
      if (!getNotificationCategorySubscriptionsList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize);
      }
      notificationCategorySubscriptionsMemoizedSerializedSize = dataSize;
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageTag_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, languageTag_);
    }
    if (validationState_
        != com.google.cloud.essentialcontacts.v1.ValidationState.VALIDATION_STATE_UNSPECIFIED
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, validationState_);
    }
    if (validateTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getValidateTime());
    }
    size += getUnknownFields().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.essentialcontacts.v1.Contact)) {
      return super.equals(obj);
    }
    com.google.cloud.essentialcontacts.v1.Contact other =
        (com.google.cloud.essentialcontacts.v1.Contact) obj;

    if (!getName().equals(other.getName())) return false;
    if (!getEmail().equals(other.getEmail())) return false;
    if (!notificationCategorySubscriptions_.equals(other.notificationCategorySubscriptions_))
      return false;
    if (!getLanguageTag().equals(other.getLanguageTag())) return false;
    if (validationState_ != other.validationState_) return false;
    if (hasValidateTime() != other.hasValidateTime()) return false;
    if (hasValidateTime()) {
      if (!getValidateTime().equals(other.getValidateTime())) return false;
    }
    if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    hash = (37 * hash) + EMAIL_FIELD_NUMBER;
    hash = (53 * hash) + getEmail().hashCode();
    if (getNotificationCategorySubscriptionsCount() > 0) {
      hash = (37 * hash) + NOTIFICATION_CATEGORY_SUBSCRIPTIONS_FIELD_NUMBER;
      hash = (53 * hash) + notificationCategorySubscriptions_.hashCode();
    }
    hash = (37 * hash) + LANGUAGE_TAG_FIELD_NUMBER;
    hash = (53 * hash) + getLanguageTag().hashCode();
    hash = (37 * hash) + VALIDATION_STATE_FIELD_NUMBER;
    hash = (53 * hash) + validationState_;
    if (hasValidateTime()) {
      hash = (37 * hash) + VALIDATE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getValidateTime().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.essentialcontacts.v1.Contact parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

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

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

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

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

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

  public static com.google.cloud.essentialcontacts.v1.Contact 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.essentialcontacts.v1.Contact 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 contact that will receive notifications from Google Cloud.
   * </pre>
   *
   * Protobuf type {@code google.cloud.essentialcontacts.v1.Contact}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.essentialcontacts.v1.Contact)
      com.google.cloud.essentialcontacts.v1.ContactOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.essentialcontacts.v1.Service
          .internal_static_google_cloud_essentialcontacts_v1_Contact_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.essentialcontacts.v1.Service
          .internal_static_google_cloud_essentialcontacts_v1_Contact_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.essentialcontacts.v1.Contact.class,
              com.google.cloud.essentialcontacts.v1.Contact.Builder.class);
    }

    // Construct using com.google.cloud.essentialcontacts.v1.Contact.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      name_ = "";
      email_ = "";
      notificationCategorySubscriptions_ = java.util.Collections.emptyList();
      bitField0_ = (bitField0_ & ~0x00000004);
      languageTag_ = "";
      validationState_ = 0;
      validateTime_ = null;
      if (validateTimeBuilder_ != null) {
        validateTimeBuilder_.dispose();
        validateTimeBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.essentialcontacts.v1.Service
          .internal_static_google_cloud_essentialcontacts_v1_Contact_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.essentialcontacts.v1.Contact getDefaultInstanceForType() {
      return com.google.cloud.essentialcontacts.v1.Contact.getDefaultInstance();
    }

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

    @java.lang.Override
    public com.google.cloud.essentialcontacts.v1.Contact buildPartial() {
      com.google.cloud.essentialcontacts.v1.Contact result =
          new com.google.cloud.essentialcontacts.v1.Contact(this);
      buildPartialRepeatedFields(result);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartialRepeatedFields(com.google.cloud.essentialcontacts.v1.Contact result) {
      if (((bitField0_ & 0x00000004) != 0)) {
        notificationCategorySubscriptions_ =
            java.util.Collections.unmodifiableList(notificationCategorySubscriptions_);
        bitField0_ = (bitField0_ & ~0x00000004);
      }
      result.notificationCategorySubscriptions_ = notificationCategorySubscriptions_;
    }

    private void buildPartial0(com.google.cloud.essentialcontacts.v1.Contact result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.name_ = name_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.email_ = email_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.languageTag_ = languageTag_;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.validationState_ = validationState_;
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.validateTime_ =
            validateTimeBuilder_ == null ? validateTime_ : validateTimeBuilder_.build();
      }
    }

    @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.essentialcontacts.v1.Contact) {
        return mergeFrom((com.google.cloud.essentialcontacts.v1.Contact) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.essentialcontacts.v1.Contact other) {
      if (other == com.google.cloud.essentialcontacts.v1.Contact.getDefaultInstance()) return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getEmail().isEmpty()) {
        email_ = other.email_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (!other.notificationCategorySubscriptions_.isEmpty()) {
        if (notificationCategorySubscriptions_.isEmpty()) {
          notificationCategorySubscriptions_ = other.notificationCategorySubscriptions_;
          bitField0_ = (bitField0_ & ~0x00000004);
        } else {
          ensureNotificationCategorySubscriptionsIsMutable();
          notificationCategorySubscriptions_.addAll(other.notificationCategorySubscriptions_);
        }
        onChanged();
      }
      if (!other.getLanguageTag().isEmpty()) {
        languageTag_ = other.languageTag_;
        bitField0_ |= 0x00000008;
        onChanged();
      }
      if (other.validationState_ != 0) {
        setValidationStateValue(other.getValidationStateValue());
      }
      if (other.hasValidateTime()) {
        mergeValidateTime(other.getValidateTime());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      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 {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                name_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                email_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 24:
              {
                int tmpRaw = input.readEnum();
                ensureNotificationCategorySubscriptionsIsMutable();
                notificationCategorySubscriptions_.add(tmpRaw);
                break;
              } // case 24
            case 26:
              {
                int length = input.readRawVarint32();
                int oldLimit = input.pushLimit(length);
                while (input.getBytesUntilLimit() > 0) {
                  int tmpRaw = input.readEnum();
                  ensureNotificationCategorySubscriptionsIsMutable();
                  notificationCategorySubscriptions_.add(tmpRaw);
                }
                input.popLimit(oldLimit);
                break;
              } // case 26
            case 34:
              {
                languageTag_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000008;
                break;
              } // case 34
            case 64:
              {
                validationState_ = input.readEnum();
                bitField0_ |= 0x00000010;
                break;
              } // case 64
            case 74:
              {
                input.readMessage(getValidateTimeFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000020;
                break;
              } // case 74
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * The identifier for the contact.
     * Format: {resource_type}/{resource_id}/contacts/{contact_id}
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @return The name.
     */
    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 identifier for the contact.
     * Format: {resource_type}/{resource_id}/contacts/{contact_id}
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @return The bytes for name.
     */
    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 identifier for the contact.
     * Format: {resource_type}/{resource_id}/contacts/{contact_id}
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @param value The name to set.
     * @return This builder for chaining.
     */
    public Builder setName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      name_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The identifier for the contact.
     * Format: {resource_type}/{resource_id}/contacts/{contact_id}
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {
      name_ = getDefaultInstance().getName();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The identifier for the contact.
     * Format: {resource_type}/{resource_id}/contacts/{contact_id}
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @param value The bytes for name to set.
     * @return This builder for chaining.
     */
    public Builder setNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      name_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private java.lang.Object email_ = "";
    /**
     *
     *
     * <pre>
     * Required. The email address to send notifications to. This does not need to
     * be a Google account.
     * </pre>
     *
     * <code>string email = 2;</code>
     *
     * @return The email.
     */
    public java.lang.String getEmail() {
      java.lang.Object ref = email_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        email_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The email address to send notifications to. This does not need to
     * be a Google account.
     * </pre>
     *
     * <code>string email = 2;</code>
     *
     * @return The bytes for email.
     */
    public com.google.protobuf.ByteString getEmailBytes() {
      java.lang.Object ref = email_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        email_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. The email address to send notifications to. This does not need to
     * be a Google account.
     * </pre>
     *
     * <code>string email = 2;</code>
     *
     * @param value The email to set.
     * @return This builder for chaining.
     */
    public Builder setEmail(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      email_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The email address to send notifications to. This does not need to
     * be a Google account.
     * </pre>
     *
     * <code>string email = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearEmail() {
      email_ = getDefaultInstance().getEmail();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. The email address to send notifications to. This does not need to
     * be a Google account.
     * </pre>
     *
     * <code>string email = 2;</code>
     *
     * @param value The bytes for email to set.
     * @return This builder for chaining.
     */
    public Builder setEmailBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      email_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private java.util.List<java.lang.Integer> notificationCategorySubscriptions_ =
        java.util.Collections.emptyList();

    private void ensureNotificationCategorySubscriptionsIsMutable() {
      if (!((bitField0_ & 0x00000004) != 0)) {
        notificationCategorySubscriptions_ =
            new java.util.ArrayList<java.lang.Integer>(notificationCategorySubscriptions_);
        bitField0_ |= 0x00000004;
      }
    }
    /**
     *
     *
     * <pre>
     * The categories of notifications that the contact will receive
     * communications for.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
     * </code>
     *
     * @return A list containing the notificationCategorySubscriptions.
     */
    public java.util.List<com.google.cloud.essentialcontacts.v1.NotificationCategory>
        getNotificationCategorySubscriptionsList() {
      return new com.google.protobuf.Internal.ListAdapter<
          java.lang.Integer, com.google.cloud.essentialcontacts.v1.NotificationCategory>(
          notificationCategorySubscriptions_, notificationCategorySubscriptions_converter_);
    }
    /**
     *
     *
     * <pre>
     * The categories of notifications that the contact will receive
     * communications for.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
     * </code>
     *
     * @return The count of notificationCategorySubscriptions.
     */
    public int getNotificationCategorySubscriptionsCount() {
      return notificationCategorySubscriptions_.size();
    }
    /**
     *
     *
     * <pre>
     * The categories of notifications that the contact will receive
     * communications for.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
     * </code>
     *
     * @param index The index of the element to return.
     * @return The notificationCategorySubscriptions at the given index.
     */
    public com.google.cloud.essentialcontacts.v1.NotificationCategory
        getNotificationCategorySubscriptions(int index) {
      return notificationCategorySubscriptions_converter_.convert(
          notificationCategorySubscriptions_.get(index));
    }
    /**
     *
     *
     * <pre>
     * The categories of notifications that the contact will receive
     * communications for.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
     * </code>
     *
     * @param index The index to set the value at.
     * @param value The notificationCategorySubscriptions to set.
     * @return This builder for chaining.
     */
    public Builder setNotificationCategorySubscriptions(
        int index, com.google.cloud.essentialcontacts.v1.NotificationCategory value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureNotificationCategorySubscriptionsIsMutable();
      notificationCategorySubscriptions_.set(index, value.getNumber());
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The categories of notifications that the contact will receive
     * communications for.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
     * </code>
     *
     * @param value The notificationCategorySubscriptions to add.
     * @return This builder for chaining.
     */
    public Builder addNotificationCategorySubscriptions(
        com.google.cloud.essentialcontacts.v1.NotificationCategory value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureNotificationCategorySubscriptionsIsMutable();
      notificationCategorySubscriptions_.add(value.getNumber());
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The categories of notifications that the contact will receive
     * communications for.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
     * </code>
     *
     * @param values The notificationCategorySubscriptions to add.
     * @return This builder for chaining.
     */
    public Builder addAllNotificationCategorySubscriptions(
        java.lang.Iterable<? extends com.google.cloud.essentialcontacts.v1.NotificationCategory>
            values) {
      ensureNotificationCategorySubscriptionsIsMutable();
      for (com.google.cloud.essentialcontacts.v1.NotificationCategory value : values) {
        notificationCategorySubscriptions_.add(value.getNumber());
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The categories of notifications that the contact will receive
     * communications for.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearNotificationCategorySubscriptions() {
      notificationCategorySubscriptions_ = java.util.Collections.emptyList();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The categories of notifications that the contact will receive
     * communications for.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
     * </code>
     *
     * @return A list containing the enum numeric values on the wire for
     *     notificationCategorySubscriptions.
     */
    public java.util.List<java.lang.Integer> getNotificationCategorySubscriptionsValueList() {
      return java.util.Collections.unmodifiableList(notificationCategorySubscriptions_);
    }
    /**
     *
     *
     * <pre>
     * The categories of notifications that the contact will receive
     * communications for.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
     * </code>
     *
     * @param index The index of the value to return.
     * @return The enum numeric value on the wire of notificationCategorySubscriptions at the given
     *     index.
     */
    public int getNotificationCategorySubscriptionsValue(int index) {
      return notificationCategorySubscriptions_.get(index);
    }
    /**
     *
     *
     * <pre>
     * The categories of notifications that the contact will receive
     * communications for.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
     * </code>
     *
     * @param index The index to set the value at.
     * @param value The enum numeric value on the wire for notificationCategorySubscriptions to set.
     * @return This builder for chaining.
     */
    public Builder setNotificationCategorySubscriptionsValue(int index, int value) {
      ensureNotificationCategorySubscriptionsIsMutable();
      notificationCategorySubscriptions_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The categories of notifications that the contact will receive
     * communications for.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
     * </code>
     *
     * @param value The enum numeric value on the wire for notificationCategorySubscriptions to add.
     * @return This builder for chaining.
     */
    public Builder addNotificationCategorySubscriptionsValue(int value) {
      ensureNotificationCategorySubscriptionsIsMutable();
      notificationCategorySubscriptions_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The categories of notifications that the contact will receive
     * communications for.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.essentialcontacts.v1.NotificationCategory notification_category_subscriptions = 3;
     * </code>
     *
     * @param values The enum numeric values on the wire for notificationCategorySubscriptions to
     *     add.
     * @return This builder for chaining.
     */
    public Builder addAllNotificationCategorySubscriptionsValue(
        java.lang.Iterable<java.lang.Integer> values) {
      ensureNotificationCategorySubscriptionsIsMutable();
      for (int value : values) {
        notificationCategorySubscriptions_.add(value);
      }
      onChanged();
      return this;
    }

    private java.lang.Object languageTag_ = "";
    /**
     *
     *
     * <pre>
     * The preferred language for notifications, as a ISO 639-1 language code. See
     * [Supported
     * languages](https://cloud.google.com/resource-manager/docs/managing-notification-contacts#supported-languages)
     * for a list of supported languages.
     * </pre>
     *
     * <code>string language_tag = 4;</code>
     *
     * @return The languageTag.
     */
    public java.lang.String getLanguageTag() {
      java.lang.Object ref = languageTag_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        languageTag_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The preferred language for notifications, as a ISO 639-1 language code. See
     * [Supported
     * languages](https://cloud.google.com/resource-manager/docs/managing-notification-contacts#supported-languages)
     * for a list of supported languages.
     * </pre>
     *
     * <code>string language_tag = 4;</code>
     *
     * @return The bytes for languageTag.
     */
    public com.google.protobuf.ByteString getLanguageTagBytes() {
      java.lang.Object ref = languageTag_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        languageTag_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The preferred language for notifications, as a ISO 639-1 language code. See
     * [Supported
     * languages](https://cloud.google.com/resource-manager/docs/managing-notification-contacts#supported-languages)
     * for a list of supported languages.
     * </pre>
     *
     * <code>string language_tag = 4;</code>
     *
     * @param value The languageTag to set.
     * @return This builder for chaining.
     */
    public Builder setLanguageTag(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      languageTag_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The preferred language for notifications, as a ISO 639-1 language code. See
     * [Supported
     * languages](https://cloud.google.com/resource-manager/docs/managing-notification-contacts#supported-languages)
     * for a list of supported languages.
     * </pre>
     *
     * <code>string language_tag = 4;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearLanguageTag() {
      languageTag_ = getDefaultInstance().getLanguageTag();
      bitField0_ = (bitField0_ & ~0x00000008);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The preferred language for notifications, as a ISO 639-1 language code. See
     * [Supported
     * languages](https://cloud.google.com/resource-manager/docs/managing-notification-contacts#supported-languages)
     * for a list of supported languages.
     * </pre>
     *
     * <code>string language_tag = 4;</code>
     *
     * @param value The bytes for languageTag to set.
     * @return This builder for chaining.
     */
    public Builder setLanguageTagBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      languageTag_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

    private int validationState_ = 0;
    /**
     *
     *
     * <pre>
     * The validity of the contact. A contact is considered valid if it is the
     * correct recipient for notifications for a particular resource.
     * </pre>
     *
     * <code>.google.cloud.essentialcontacts.v1.ValidationState validation_state = 8;</code>
     *
     * @return The enum numeric value on the wire for validationState.
     */
    @java.lang.Override
    public int getValidationStateValue() {
      return validationState_;
    }
    /**
     *
     *
     * <pre>
     * The validity of the contact. A contact is considered valid if it is the
     * correct recipient for notifications for a particular resource.
     * </pre>
     *
     * <code>.google.cloud.essentialcontacts.v1.ValidationState validation_state = 8;</code>
     *
     * @param value The enum numeric value on the wire for validationState to set.
     * @return This builder for chaining.
     */
    public Builder setValidationStateValue(int value) {
      validationState_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The validity of the contact. A contact is considered valid if it is the
     * correct recipient for notifications for a particular resource.
     * </pre>
     *
     * <code>.google.cloud.essentialcontacts.v1.ValidationState validation_state = 8;</code>
     *
     * @return The validationState.
     */
    @java.lang.Override
    public com.google.cloud.essentialcontacts.v1.ValidationState getValidationState() {
      com.google.cloud.essentialcontacts.v1.ValidationState result =
          com.google.cloud.essentialcontacts.v1.ValidationState.forNumber(validationState_);
      return result == null
          ? com.google.cloud.essentialcontacts.v1.ValidationState.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * The validity of the contact. A contact is considered valid if it is the
     * correct recipient for notifications for a particular resource.
     * </pre>
     *
     * <code>.google.cloud.essentialcontacts.v1.ValidationState validation_state = 8;</code>
     *
     * @param value The validationState to set.
     * @return This builder for chaining.
     */
    public Builder setValidationState(com.google.cloud.essentialcontacts.v1.ValidationState value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000010;
      validationState_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The validity of the contact. A contact is considered valid if it is the
     * correct recipient for notifications for a particular resource.
     * </pre>
     *
     * <code>.google.cloud.essentialcontacts.v1.ValidationState validation_state = 8;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearValidationState() {
      bitField0_ = (bitField0_ & ~0x00000010);
      validationState_ = 0;
      onChanged();
      return this;
    }

    private com.google.protobuf.Timestamp validateTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        validateTimeBuilder_;
    /**
     *
     *
     * <pre>
     * The last time the validation_state was updated, either manually or
     * automatically. A contact is considered stale if its validation state was
     * updated more than 1 year ago.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp validate_time = 9;</code>
     *
     * @return Whether the validateTime field is set.
     */
    public boolean hasValidateTime() {
      return ((bitField0_ & 0x00000020) != 0);
    }
    /**
     *
     *
     * <pre>
     * The last time the validation_state was updated, either manually or
     * automatically. A contact is considered stale if its validation state was
     * updated more than 1 year ago.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp validate_time = 9;</code>
     *
     * @return The validateTime.
     */
    public com.google.protobuf.Timestamp getValidateTime() {
      if (validateTimeBuilder_ == null) {
        return validateTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : validateTime_;
      } else {
        return validateTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The last time the validation_state was updated, either manually or
     * automatically. A contact is considered stale if its validation state was
     * updated more than 1 year ago.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp validate_time = 9;</code>
     */
    public Builder setValidateTime(com.google.protobuf.Timestamp value) {
      if (validateTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        validateTime_ = value;
      } else {
        validateTimeBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The last time the validation_state was updated, either manually or
     * automatically. A contact is considered stale if its validation state was
     * updated more than 1 year ago.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp validate_time = 9;</code>
     */
    public Builder setValidateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (validateTimeBuilder_ == null) {
        validateTime_ = builderForValue.build();
      } else {
        validateTimeBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The last time the validation_state was updated, either manually or
     * automatically. A contact is considered stale if its validation state was
     * updated more than 1 year ago.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp validate_time = 9;</code>
     */
    public Builder mergeValidateTime(com.google.protobuf.Timestamp value) {
      if (validateTimeBuilder_ == null) {
        if (((bitField0_ & 0x00000020) != 0)
            && validateTime_ != null
            && validateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          getValidateTimeBuilder().mergeFrom(value);
        } else {
          validateTime_ = value;
        }
      } else {
        validateTimeBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The last time the validation_state was updated, either manually or
     * automatically. A contact is considered stale if its validation state was
     * updated more than 1 year ago.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp validate_time = 9;</code>
     */
    public Builder clearValidateTime() {
      bitField0_ = (bitField0_ & ~0x00000020);
      validateTime_ = null;
      if (validateTimeBuilder_ != null) {
        validateTimeBuilder_.dispose();
        validateTimeBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The last time the validation_state was updated, either manually or
     * automatically. A contact is considered stale if its validation state was
     * updated more than 1 year ago.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp validate_time = 9;</code>
     */
    public com.google.protobuf.Timestamp.Builder getValidateTimeBuilder() {
      bitField0_ |= 0x00000020;
      onChanged();
      return getValidateTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The last time the validation_state was updated, either manually or
     * automatically. A contact is considered stale if its validation state was
     * updated more than 1 year ago.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp validate_time = 9;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getValidateTimeOrBuilder() {
      if (validateTimeBuilder_ != null) {
        return validateTimeBuilder_.getMessageOrBuilder();
      } else {
        return validateTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : validateTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * The last time the validation_state was updated, either manually or
     * automatically. A contact is considered stale if its validation state was
     * updated more than 1 year ago.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp validate_time = 9;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getValidateTimeFieldBuilder() {
      if (validateTimeBuilder_ == null) {
        validateTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getValidateTime(), getParentForChildren(), isClean());
        validateTime_ = null;
      }
      return validateTimeBuilder_;
    }

    @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.essentialcontacts.v1.Contact)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.essentialcontacts.v1.Contact)
  private static final com.google.cloud.essentialcontacts.v1.Contact DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.essentialcontacts.v1.Contact();
  }

  public static com.google.cloud.essentialcontacts.v1.Contact getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<Contact> PARSER =
      new com.google.protobuf.AbstractParser<Contact>() {
        @java.lang.Override
        public Contact parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.essentialcontacts.v1.Contact getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
