// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/iot/v1/resources.proto

package com.google.cloud.iot.v1;

/**
 * <pre>
 * Details of an X.509 certificate. For informational purposes only.
 * </pre>
 *
 * Protobuf type {@code google.cloud.iot.v1.X509CertificateDetails}
 */
public  final class X509CertificateDetails extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.cloud.iot.v1.X509CertificateDetails)
    X509CertificateDetailsOrBuilder {
private static final long serialVersionUID = 0L;
  // Use X509CertificateDetails.newBuilder() to construct.
  private X509CertificateDetails(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private X509CertificateDetails() {
    issuer_ = "";
    subject_ = "";
    signatureAlgorithm_ = "";
    publicKeyType_ = "";
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private X509CertificateDetails(
      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;
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
          case 10: {
            java.lang.String s = input.readStringRequireUtf8();

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

            subject_ = s;
            break;
          }
          case 26: {
            com.google.protobuf.Timestamp.Builder subBuilder = null;
            if (startTime_ != null) {
              subBuilder = startTime_.toBuilder();
            }
            startTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(startTime_);
              startTime_ = subBuilder.buildPartial();
            }

            break;
          }
          case 34: {
            com.google.protobuf.Timestamp.Builder subBuilder = null;
            if (expiryTime_ != null) {
              subBuilder = expiryTime_.toBuilder();
            }
            expiryTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(expiryTime_);
              expiryTime_ = subBuilder.buildPartial();
            }

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

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

            publicKeyType_ = s;
            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.iot.v1.ResourcesProto.internal_static_google_cloud_iot_v1_X509CertificateDetails_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.iot.v1.ResourcesProto.internal_static_google_cloud_iot_v1_X509CertificateDetails_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.iot.v1.X509CertificateDetails.class, com.google.cloud.iot.v1.X509CertificateDetails.Builder.class);
  }

  public static final int ISSUER_FIELD_NUMBER = 1;
  private volatile java.lang.Object issuer_;
  /**
   * <pre>
   * The entity that signed the certificate.
   * </pre>
   *
   * <code>string issuer = 1;</code>
   */
  public java.lang.String getIssuer() {
    java.lang.Object ref = issuer_;
    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();
      issuer_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The entity that signed the certificate.
   * </pre>
   *
   * <code>string issuer = 1;</code>
   */
  public com.google.protobuf.ByteString
      getIssuerBytes() {
    java.lang.Object ref = issuer_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      issuer_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SUBJECT_FIELD_NUMBER = 2;
  private volatile java.lang.Object subject_;
  /**
   * <pre>
   * The entity the certificate and public key belong to.
   * </pre>
   *
   * <code>string subject = 2;</code>
   */
  public java.lang.String getSubject() {
    java.lang.Object ref = subject_;
    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();
      subject_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The entity the certificate and public key belong to.
   * </pre>
   *
   * <code>string subject = 2;</code>
   */
  public com.google.protobuf.ByteString
      getSubjectBytes() {
    java.lang.Object ref = subject_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      subject_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int START_TIME_FIELD_NUMBER = 3;
  private com.google.protobuf.Timestamp startTime_;
  /**
   * <pre>
   * The time the certificate becomes valid.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp start_time = 3;</code>
   */
  public boolean hasStartTime() {
    return startTime_ != null;
  }
  /**
   * <pre>
   * The time the certificate becomes valid.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp start_time = 3;</code>
   */
  public com.google.protobuf.Timestamp getStartTime() {
    return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_;
  }
  /**
   * <pre>
   * The time the certificate becomes valid.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp start_time = 3;</code>
   */
  public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() {
    return getStartTime();
  }

  public static final int EXPIRY_TIME_FIELD_NUMBER = 4;
  private com.google.protobuf.Timestamp expiryTime_;
  /**
   * <pre>
   * The time the certificate becomes invalid.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp expiry_time = 4;</code>
   */
  public boolean hasExpiryTime() {
    return expiryTime_ != null;
  }
  /**
   * <pre>
   * The time the certificate becomes invalid.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp expiry_time = 4;</code>
   */
  public com.google.protobuf.Timestamp getExpiryTime() {
    return expiryTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expiryTime_;
  }
  /**
   * <pre>
   * The time the certificate becomes invalid.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp expiry_time = 4;</code>
   */
  public com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder() {
    return getExpiryTime();
  }

  public static final int SIGNATURE_ALGORITHM_FIELD_NUMBER = 5;
  private volatile java.lang.Object signatureAlgorithm_;
  /**
   * <pre>
   * The algorithm used to sign the certificate.
   * </pre>
   *
   * <code>string signature_algorithm = 5;</code>
   */
  public java.lang.String getSignatureAlgorithm() {
    java.lang.Object ref = signatureAlgorithm_;
    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();
      signatureAlgorithm_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The algorithm used to sign the certificate.
   * </pre>
   *
   * <code>string signature_algorithm = 5;</code>
   */
  public com.google.protobuf.ByteString
      getSignatureAlgorithmBytes() {
    java.lang.Object ref = signatureAlgorithm_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      signatureAlgorithm_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PUBLIC_KEY_TYPE_FIELD_NUMBER = 6;
  private volatile java.lang.Object publicKeyType_;
  /**
   * <pre>
   * The type of public key in the certificate.
   * </pre>
   *
   * <code>string public_key_type = 6;</code>
   */
  public java.lang.String getPublicKeyType() {
    java.lang.Object ref = publicKeyType_;
    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();
      publicKeyType_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The type of public key in the certificate.
   * </pre>
   *
   * <code>string public_key_type = 6;</code>
   */
  public com.google.protobuf.ByteString
      getPublicKeyTypeBytes() {
    java.lang.Object ref = publicKeyType_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      publicKeyType_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (!getIssuerBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, issuer_);
    }
    if (!getSubjectBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, subject_);
    }
    if (startTime_ != null) {
      output.writeMessage(3, getStartTime());
    }
    if (expiryTime_ != null) {
      output.writeMessage(4, getExpiryTime());
    }
    if (!getSignatureAlgorithmBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, signatureAlgorithm_);
    }
    if (!getPublicKeyTypeBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, publicKeyType_);
    }
    unknownFields.writeTo(output);
  }

  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!getIssuerBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, issuer_);
    }
    if (!getSubjectBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, subject_);
    }
    if (startTime_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, getStartTime());
    }
    if (expiryTime_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, getExpiryTime());
    }
    if (!getSignatureAlgorithmBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, signatureAlgorithm_);
    }
    if (!getPublicKeyTypeBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, publicKeyType_);
    }
    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.iot.v1.X509CertificateDetails)) {
      return super.equals(obj);
    }
    com.google.cloud.iot.v1.X509CertificateDetails other = (com.google.cloud.iot.v1.X509CertificateDetails) obj;

    boolean result = true;
    result = result && getIssuer()
        .equals(other.getIssuer());
    result = result && getSubject()
        .equals(other.getSubject());
    result = result && (hasStartTime() == other.hasStartTime());
    if (hasStartTime()) {
      result = result && getStartTime()
          .equals(other.getStartTime());
    }
    result = result && (hasExpiryTime() == other.hasExpiryTime());
    if (hasExpiryTime()) {
      result = result && getExpiryTime()
          .equals(other.getExpiryTime());
    }
    result = result && getSignatureAlgorithm()
        .equals(other.getSignatureAlgorithm());
    result = result && getPublicKeyType()
        .equals(other.getPublicKeyType());
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + ISSUER_FIELD_NUMBER;
    hash = (53 * hash) + getIssuer().hashCode();
    hash = (37 * hash) + SUBJECT_FIELD_NUMBER;
    hash = (53 * hash) + getSubject().hashCode();
    if (hasStartTime()) {
      hash = (37 * hash) + START_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getStartTime().hashCode();
    }
    if (hasExpiryTime()) {
      hash = (37 * hash) + EXPIRY_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getExpiryTime().hashCode();
    }
    hash = (37 * hash) + SIGNATURE_ALGORITHM_FIELD_NUMBER;
    hash = (53 * hash) + getSignatureAlgorithm().hashCode();
    hash = (37 * hash) + PUBLIC_KEY_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + getPublicKeyType().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.iot.v1.X509CertificateDetails parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.iot.v1.X509CertificateDetails 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.iot.v1.X509CertificateDetails parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.iot.v1.X509CertificateDetails 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.iot.v1.X509CertificateDetails parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.iot.v1.X509CertificateDetails parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.iot.v1.X509CertificateDetails parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.iot.v1.X509CertificateDetails 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.iot.v1.X509CertificateDetails parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.cloud.iot.v1.X509CertificateDetails 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.iot.v1.X509CertificateDetails parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.iot.v1.X509CertificateDetails parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.cloud.iot.v1.X509CertificateDetails prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  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>
   * Details of an X.509 certificate. For informational purposes only.
   * </pre>
   *
   * Protobuf type {@code google.cloud.iot.v1.X509CertificateDetails}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.cloud.iot.v1.X509CertificateDetails)
      com.google.cloud.iot.v1.X509CertificateDetailsOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.cloud.iot.v1.ResourcesProto.internal_static_google_cloud_iot_v1_X509CertificateDetails_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.iot.v1.ResourcesProto.internal_static_google_cloud_iot_v1_X509CertificateDetails_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.iot.v1.X509CertificateDetails.class, com.google.cloud.iot.v1.X509CertificateDetails.Builder.class);
    }

    // Construct using com.google.cloud.iot.v1.X509CertificateDetails.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    public Builder clear() {
      super.clear();
      issuer_ = "";

      subject_ = "";

      if (startTimeBuilder_ == null) {
        startTime_ = null;
      } else {
        startTime_ = null;
        startTimeBuilder_ = null;
      }
      if (expiryTimeBuilder_ == null) {
        expiryTime_ = null;
      } else {
        expiryTime_ = null;
        expiryTimeBuilder_ = null;
      }
      signatureAlgorithm_ = "";

      publicKeyType_ = "";

      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.cloud.iot.v1.ResourcesProto.internal_static_google_cloud_iot_v1_X509CertificateDetails_descriptor;
    }

    public com.google.cloud.iot.v1.X509CertificateDetails getDefaultInstanceForType() {
      return com.google.cloud.iot.v1.X509CertificateDetails.getDefaultInstance();
    }

    public com.google.cloud.iot.v1.X509CertificateDetails build() {
      com.google.cloud.iot.v1.X509CertificateDetails result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public com.google.cloud.iot.v1.X509CertificateDetails buildPartial() {
      com.google.cloud.iot.v1.X509CertificateDetails result = new com.google.cloud.iot.v1.X509CertificateDetails(this);
      result.issuer_ = issuer_;
      result.subject_ = subject_;
      if (startTimeBuilder_ == null) {
        result.startTime_ = startTime_;
      } else {
        result.startTime_ = startTimeBuilder_.build();
      }
      if (expiryTimeBuilder_ == null) {
        result.expiryTime_ = expiryTime_;
      } else {
        result.expiryTime_ = expiryTimeBuilder_.build();
      }
      result.signatureAlgorithm_ = signatureAlgorithm_;
      result.publicKeyType_ = publicKeyType_;
      onBuilt();
      return result;
    }

    public Builder clone() {
      return (Builder) super.clone();
    }
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.setField(field, value);
    }
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.iot.v1.X509CertificateDetails) {
        return mergeFrom((com.google.cloud.iot.v1.X509CertificateDetails)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.iot.v1.X509CertificateDetails other) {
      if (other == com.google.cloud.iot.v1.X509CertificateDetails.getDefaultInstance()) return this;
      if (!other.getIssuer().isEmpty()) {
        issuer_ = other.issuer_;
        onChanged();
      }
      if (!other.getSubject().isEmpty()) {
        subject_ = other.subject_;
        onChanged();
      }
      if (other.hasStartTime()) {
        mergeStartTime(other.getStartTime());
      }
      if (other.hasExpiryTime()) {
        mergeExpiryTime(other.getExpiryTime());
      }
      if (!other.getSignatureAlgorithm().isEmpty()) {
        signatureAlgorithm_ = other.signatureAlgorithm_;
        onChanged();
      }
      if (!other.getPublicKeyType().isEmpty()) {
        publicKeyType_ = other.publicKeyType_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

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

    private java.lang.Object issuer_ = "";
    /**
     * <pre>
     * The entity that signed the certificate.
     * </pre>
     *
     * <code>string issuer = 1;</code>
     */
    public java.lang.String getIssuer() {
      java.lang.Object ref = issuer_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        issuer_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The entity that signed the certificate.
     * </pre>
     *
     * <code>string issuer = 1;</code>
     */
    public com.google.protobuf.ByteString
        getIssuerBytes() {
      java.lang.Object ref = issuer_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        issuer_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The entity that signed the certificate.
     * </pre>
     *
     * <code>string issuer = 1;</code>
     */
    public Builder setIssuer(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      issuer_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The entity that signed the certificate.
     * </pre>
     *
     * <code>string issuer = 1;</code>
     */
    public Builder clearIssuer() {
      
      issuer_ = getDefaultInstance().getIssuer();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The entity that signed the certificate.
     * </pre>
     *
     * <code>string issuer = 1;</code>
     */
    public Builder setIssuerBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      issuer_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object subject_ = "";
    /**
     * <pre>
     * The entity the certificate and public key belong to.
     * </pre>
     *
     * <code>string subject = 2;</code>
     */
    public java.lang.String getSubject() {
      java.lang.Object ref = subject_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        subject_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The entity the certificate and public key belong to.
     * </pre>
     *
     * <code>string subject = 2;</code>
     */
    public com.google.protobuf.ByteString
        getSubjectBytes() {
      java.lang.Object ref = subject_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        subject_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The entity the certificate and public key belong to.
     * </pre>
     *
     * <code>string subject = 2;</code>
     */
    public Builder setSubject(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      subject_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The entity the certificate and public key belong to.
     * </pre>
     *
     * <code>string subject = 2;</code>
     */
    public Builder clearSubject() {
      
      subject_ = getDefaultInstance().getSubject();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The entity the certificate and public key belong to.
     * </pre>
     *
     * <code>string subject = 2;</code>
     */
    public Builder setSubjectBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      subject_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.Timestamp startTime_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_;
    /**
     * <pre>
     * The time the certificate becomes valid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 3;</code>
     */
    public boolean hasStartTime() {
      return startTimeBuilder_ != null || startTime_ != null;
    }
    /**
     * <pre>
     * The time the certificate becomes valid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 3;</code>
     */
    public com.google.protobuf.Timestamp getStartTime() {
      if (startTimeBuilder_ == null) {
        return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_;
      } else {
        return startTimeBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The time the certificate becomes valid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 3;</code>
     */
    public Builder setStartTime(com.google.protobuf.Timestamp value) {
      if (startTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        startTime_ = value;
        onChanged();
      } else {
        startTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * The time the certificate becomes valid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 3;</code>
     */
    public Builder setStartTime(
        com.google.protobuf.Timestamp.Builder builderForValue) {
      if (startTimeBuilder_ == null) {
        startTime_ = builderForValue.build();
        onChanged();
      } else {
        startTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * The time the certificate becomes valid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 3;</code>
     */
    public Builder mergeStartTime(com.google.protobuf.Timestamp value) {
      if (startTimeBuilder_ == null) {
        if (startTime_ != null) {
          startTime_ =
            com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial();
        } else {
          startTime_ = value;
        }
        onChanged();
      } else {
        startTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * The time the certificate becomes valid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 3;</code>
     */
    public Builder clearStartTime() {
      if (startTimeBuilder_ == null) {
        startTime_ = null;
        onChanged();
      } else {
        startTime_ = null;
        startTimeBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * The time the certificate becomes valid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 3;</code>
     */
    public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() {
      
      onChanged();
      return getStartTimeFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The time the certificate becomes valid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 3;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() {
      if (startTimeBuilder_ != null) {
        return startTimeBuilder_.getMessageOrBuilder();
      } else {
        return startTime_ == null ?
            com.google.protobuf.Timestamp.getDefaultInstance() : startTime_;
      }
    }
    /**
     * <pre>
     * The time the certificate becomes valid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp start_time = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> 
        getStartTimeFieldBuilder() {
      if (startTimeBuilder_ == null) {
        startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
                getStartTime(),
                getParentForChildren(),
                isClean());
        startTime_ = null;
      }
      return startTimeBuilder_;
    }

    private com.google.protobuf.Timestamp expiryTime_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> expiryTimeBuilder_;
    /**
     * <pre>
     * The time the certificate becomes invalid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp expiry_time = 4;</code>
     */
    public boolean hasExpiryTime() {
      return expiryTimeBuilder_ != null || expiryTime_ != null;
    }
    /**
     * <pre>
     * The time the certificate becomes invalid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp expiry_time = 4;</code>
     */
    public com.google.protobuf.Timestamp getExpiryTime() {
      if (expiryTimeBuilder_ == null) {
        return expiryTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expiryTime_;
      } else {
        return expiryTimeBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The time the certificate becomes invalid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp expiry_time = 4;</code>
     */
    public Builder setExpiryTime(com.google.protobuf.Timestamp value) {
      if (expiryTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        expiryTime_ = value;
        onChanged();
      } else {
        expiryTimeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * The time the certificate becomes invalid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp expiry_time = 4;</code>
     */
    public Builder setExpiryTime(
        com.google.protobuf.Timestamp.Builder builderForValue) {
      if (expiryTimeBuilder_ == null) {
        expiryTime_ = builderForValue.build();
        onChanged();
      } else {
        expiryTimeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * The time the certificate becomes invalid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp expiry_time = 4;</code>
     */
    public Builder mergeExpiryTime(com.google.protobuf.Timestamp value) {
      if (expiryTimeBuilder_ == null) {
        if (expiryTime_ != null) {
          expiryTime_ =
            com.google.protobuf.Timestamp.newBuilder(expiryTime_).mergeFrom(value).buildPartial();
        } else {
          expiryTime_ = value;
        }
        onChanged();
      } else {
        expiryTimeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * The time the certificate becomes invalid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp expiry_time = 4;</code>
     */
    public Builder clearExpiryTime() {
      if (expiryTimeBuilder_ == null) {
        expiryTime_ = null;
        onChanged();
      } else {
        expiryTime_ = null;
        expiryTimeBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * The time the certificate becomes invalid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp expiry_time = 4;</code>
     */
    public com.google.protobuf.Timestamp.Builder getExpiryTimeBuilder() {
      
      onChanged();
      return getExpiryTimeFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The time the certificate becomes invalid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp expiry_time = 4;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getExpiryTimeOrBuilder() {
      if (expiryTimeBuilder_ != null) {
        return expiryTimeBuilder_.getMessageOrBuilder();
      } else {
        return expiryTime_ == null ?
            com.google.protobuf.Timestamp.getDefaultInstance() : expiryTime_;
      }
    }
    /**
     * <pre>
     * The time the certificate becomes invalid.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp expiry_time = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> 
        getExpiryTimeFieldBuilder() {
      if (expiryTimeBuilder_ == null) {
        expiryTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
                getExpiryTime(),
                getParentForChildren(),
                isClean());
        expiryTime_ = null;
      }
      return expiryTimeBuilder_;
    }

    private java.lang.Object signatureAlgorithm_ = "";
    /**
     * <pre>
     * The algorithm used to sign the certificate.
     * </pre>
     *
     * <code>string signature_algorithm = 5;</code>
     */
    public java.lang.String getSignatureAlgorithm() {
      java.lang.Object ref = signatureAlgorithm_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        signatureAlgorithm_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The algorithm used to sign the certificate.
     * </pre>
     *
     * <code>string signature_algorithm = 5;</code>
     */
    public com.google.protobuf.ByteString
        getSignatureAlgorithmBytes() {
      java.lang.Object ref = signatureAlgorithm_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        signatureAlgorithm_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The algorithm used to sign the certificate.
     * </pre>
     *
     * <code>string signature_algorithm = 5;</code>
     */
    public Builder setSignatureAlgorithm(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      signatureAlgorithm_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The algorithm used to sign the certificate.
     * </pre>
     *
     * <code>string signature_algorithm = 5;</code>
     */
    public Builder clearSignatureAlgorithm() {
      
      signatureAlgorithm_ = getDefaultInstance().getSignatureAlgorithm();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The algorithm used to sign the certificate.
     * </pre>
     *
     * <code>string signature_algorithm = 5;</code>
     */
    public Builder setSignatureAlgorithmBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      signatureAlgorithm_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object publicKeyType_ = "";
    /**
     * <pre>
     * The type of public key in the certificate.
     * </pre>
     *
     * <code>string public_key_type = 6;</code>
     */
    public java.lang.String getPublicKeyType() {
      java.lang.Object ref = publicKeyType_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        publicKeyType_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The type of public key in the certificate.
     * </pre>
     *
     * <code>string public_key_type = 6;</code>
     */
    public com.google.protobuf.ByteString
        getPublicKeyTypeBytes() {
      java.lang.Object ref = publicKeyType_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        publicKeyType_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The type of public key in the certificate.
     * </pre>
     *
     * <code>string public_key_type = 6;</code>
     */
    public Builder setPublicKeyType(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      publicKeyType_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The type of public key in the certificate.
     * </pre>
     *
     * <code>string public_key_type = 6;</code>
     */
    public Builder clearPublicKeyType() {
      
      publicKeyType_ = getDefaultInstance().getPublicKeyType();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The type of public key in the certificate.
     * </pre>
     *
     * <code>string public_key_type = 6;</code>
     */
    public Builder setPublicKeyTypeBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      publicKeyType_ = value;
      onChanged();
      return this;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

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


    // @@protoc_insertion_point(builder_scope:google.cloud.iot.v1.X509CertificateDetails)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.iot.v1.X509CertificateDetails)
  private static final com.google.cloud.iot.v1.X509CertificateDetails DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.cloud.iot.v1.X509CertificateDetails();
  }

  public static com.google.cloud.iot.v1.X509CertificateDetails getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  public com.google.cloud.iot.v1.X509CertificateDetails getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

