/*
 * 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/security/privateca/v1/resources.proto

package com.google.cloud.security.privateca.v1;

/**
 *
 *
 * <pre>
 * A [Certificate][google.cloud.security.privateca.v1.Certificate] corresponds
 * to a signed X.509 certificate issued by a
 * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].
 * </pre>
 *
 * Protobuf type {@code google.cloud.security.privateca.v1.Certificate}
 */
public final class Certificate extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.security.privateca.v1.Certificate)
    CertificateOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use Certificate.newBuilder() to construct.
  private Certificate(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private Certificate() {
    name_ = "";
    issuerCertificateAuthority_ = "";
    certificateTemplate_ = "";
    subjectMode_ = 0;
    pemCertificate_ = "";
    pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.EMPTY;
  }

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

  @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.security.privateca.v1.PrivateCaResourcesProto
        .internal_static_google_cloud_security_privateca_v1_Certificate_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapField internalGetMapField(int number) {
    switch (number) {
      case 14:
        return internalGetLabels();
      default:
        throw new RuntimeException("Invalid map field number: " + number);
    }
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.security.privateca.v1.PrivateCaResourcesProto
        .internal_static_google_cloud_security_privateca_v1_Certificate_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.security.privateca.v1.Certificate.class,
            com.google.cloud.security.privateca.v1.Certificate.Builder.class);
  }

  public interface RevocationDetailsOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.cloud.security.privateca.v1.Certificate.RevocationDetails)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Indicates why a
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was
     * revoked.
     * </pre>
     *
     * <code>.google.cloud.security.privateca.v1.RevocationReason revocation_state = 1;</code>
     *
     * @return The enum numeric value on the wire for revocationState.
     */
    int getRevocationStateValue();
    /**
     *
     *
     * <pre>
     * Indicates why a
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was
     * revoked.
     * </pre>
     *
     * <code>.google.cloud.security.privateca.v1.RevocationReason revocation_state = 1;</code>
     *
     * @return The revocationState.
     */
    com.google.cloud.security.privateca.v1.RevocationReason getRevocationState();

    /**
     *
     *
     * <pre>
     * The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was
     * revoked.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp revocation_time = 2;</code>
     *
     * @return Whether the revocationTime field is set.
     */
    boolean hasRevocationTime();
    /**
     *
     *
     * <pre>
     * The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was
     * revoked.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp revocation_time = 2;</code>
     *
     * @return The revocationTime.
     */
    com.google.protobuf.Timestamp getRevocationTime();
    /**
     *
     *
     * <pre>
     * The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was
     * revoked.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp revocation_time = 2;</code>
     */
    com.google.protobuf.TimestampOrBuilder getRevocationTimeOrBuilder();
  }
  /**
   *
   *
   * <pre>
   * Describes fields that are relavent to the revocation of a
   * [Certificate][google.cloud.security.privateca.v1.Certificate].
   * </pre>
   *
   * Protobuf type {@code google.cloud.security.privateca.v1.Certificate.RevocationDetails}
   */
  public static final class RevocationDetails extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.cloud.security.privateca.v1.Certificate.RevocationDetails)
      RevocationDetailsOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use RevocationDetails.newBuilder() to construct.
    private RevocationDetails(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private RevocationDetails() {
      revocationState_ = 0;
    }

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

    @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.security.privateca.v1.PrivateCaResourcesProto
          .internal_static_google_cloud_security_privateca_v1_Certificate_RevocationDetails_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.security.privateca.v1.PrivateCaResourcesProto
          .internal_static_google_cloud_security_privateca_v1_Certificate_RevocationDetails_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.security.privateca.v1.Certificate.RevocationDetails.class,
              com.google.cloud.security.privateca.v1.Certificate.RevocationDetails.Builder.class);
    }

    public static final int REVOCATION_STATE_FIELD_NUMBER = 1;
    private int revocationState_ = 0;
    /**
     *
     *
     * <pre>
     * Indicates why a
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was
     * revoked.
     * </pre>
     *
     * <code>.google.cloud.security.privateca.v1.RevocationReason revocation_state = 1;</code>
     *
     * @return The enum numeric value on the wire for revocationState.
     */
    @java.lang.Override
    public int getRevocationStateValue() {
      return revocationState_;
    }
    /**
     *
     *
     * <pre>
     * Indicates why a
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was
     * revoked.
     * </pre>
     *
     * <code>.google.cloud.security.privateca.v1.RevocationReason revocation_state = 1;</code>
     *
     * @return The revocationState.
     */
    @java.lang.Override
    public com.google.cloud.security.privateca.v1.RevocationReason getRevocationState() {
      com.google.cloud.security.privateca.v1.RevocationReason result =
          com.google.cloud.security.privateca.v1.RevocationReason.forNumber(revocationState_);
      return result == null
          ? com.google.cloud.security.privateca.v1.RevocationReason.UNRECOGNIZED
          : result;
    }

    public static final int REVOCATION_TIME_FIELD_NUMBER = 2;
    private com.google.protobuf.Timestamp revocationTime_;
    /**
     *
     *
     * <pre>
     * The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was
     * revoked.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp revocation_time = 2;</code>
     *
     * @return Whether the revocationTime field is set.
     */
    @java.lang.Override
    public boolean hasRevocationTime() {
      return revocationTime_ != null;
    }
    /**
     *
     *
     * <pre>
     * The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was
     * revoked.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp revocation_time = 2;</code>
     *
     * @return The revocationTime.
     */
    @java.lang.Override
    public com.google.protobuf.Timestamp getRevocationTime() {
      return revocationTime_ == null
          ? com.google.protobuf.Timestamp.getDefaultInstance()
          : revocationTime_;
    }
    /**
     *
     *
     * <pre>
     * The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was
     * revoked.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp revocation_time = 2;</code>
     */
    @java.lang.Override
    public com.google.protobuf.TimestampOrBuilder getRevocationTimeOrBuilder() {
      return revocationTime_ == null
          ? com.google.protobuf.Timestamp.getDefaultInstance()
          : revocationTime_;
    }

    private byte memoizedIsInitialized = -1;

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

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      if (revocationState_
          != com.google.cloud.security.privateca.v1.RevocationReason.REVOCATION_REASON_UNSPECIFIED
              .getNumber()) {
        output.writeEnum(1, revocationState_);
      }
      if (revocationTime_ != null) {
        output.writeMessage(2, getRevocationTime());
      }
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      if (revocationState_
          != com.google.cloud.security.privateca.v1.RevocationReason.REVOCATION_REASON_UNSPECIFIED
              .getNumber()) {
        size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, revocationState_);
      }
      if (revocationTime_ != null) {
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRevocationTime());
      }
      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.security.privateca.v1.Certificate.RevocationDetails)) {
        return super.equals(obj);
      }
      com.google.cloud.security.privateca.v1.Certificate.RevocationDetails other =
          (com.google.cloud.security.privateca.v1.Certificate.RevocationDetails) obj;

      if (revocationState_ != other.revocationState_) return false;
      if (hasRevocationTime() != other.hasRevocationTime()) return false;
      if (hasRevocationTime()) {
        if (!getRevocationTime().equals(other.getRevocationTime())) 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) + REVOCATION_STATE_FIELD_NUMBER;
      hash = (53 * hash) + revocationState_;
      if (hasRevocationTime()) {
        hash = (37 * hash) + REVOCATION_TIME_FIELD_NUMBER;
        hash = (53 * hash) + getRevocationTime().hashCode();
      }
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.cloud.security.privateca.v1.Certificate.RevocationDetails parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

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

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

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

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

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

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

    public static com.google.cloud.security.privateca.v1.Certificate.RevocationDetails 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.security.privateca.v1.Certificate.RevocationDetails 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>
     * Describes fields that are relavent to the revocation of a
     * [Certificate][google.cloud.security.privateca.v1.Certificate].
     * </pre>
     *
     * Protobuf type {@code google.cloud.security.privateca.v1.Certificate.RevocationDetails}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.cloud.security.privateca.v1.Certificate.RevocationDetails)
        com.google.cloud.security.privateca.v1.Certificate.RevocationDetailsOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.security.privateca.v1.PrivateCaResourcesProto
            .internal_static_google_cloud_security_privateca_v1_Certificate_RevocationDetails_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.cloud.security.privateca.v1.PrivateCaResourcesProto
            .internal_static_google_cloud_security_privateca_v1_Certificate_RevocationDetails_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.security.privateca.v1.Certificate.RevocationDetails.class,
                com.google.cloud.security.privateca.v1.Certificate.RevocationDetails.Builder.class);
      }

      // Construct using
      // com.google.cloud.security.privateca.v1.Certificate.RevocationDetails.newBuilder()
      private Builder() {}

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

      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        revocationState_ = 0;
        revocationTime_ = null;
        if (revocationTimeBuilder_ != null) {
          revocationTimeBuilder_.dispose();
          revocationTimeBuilder_ = null;
        }
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.cloud.security.privateca.v1.PrivateCaResourcesProto
            .internal_static_google_cloud_security_privateca_v1_Certificate_RevocationDetails_descriptor;
      }

      @java.lang.Override
      public com.google.cloud.security.privateca.v1.Certificate.RevocationDetails
          getDefaultInstanceForType() {
        return com.google.cloud.security.privateca.v1.Certificate.RevocationDetails
            .getDefaultInstance();
      }

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

      @java.lang.Override
      public com.google.cloud.security.privateca.v1.Certificate.RevocationDetails buildPartial() {
        com.google.cloud.security.privateca.v1.Certificate.RevocationDetails result =
            new com.google.cloud.security.privateca.v1.Certificate.RevocationDetails(this);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        onBuilt();
        return result;
      }

      private void buildPartial0(
          com.google.cloud.security.privateca.v1.Certificate.RevocationDetails result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.revocationState_ = revocationState_;
        }
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.revocationTime_ =
              revocationTimeBuilder_ == null ? revocationTime_ : revocationTimeBuilder_.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.security.privateca.v1.Certificate.RevocationDetails) {
          return mergeFrom(
              (com.google.cloud.security.privateca.v1.Certificate.RevocationDetails) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.cloud.security.privateca.v1.Certificate.RevocationDetails other) {
        if (other
            == com.google.cloud.security.privateca.v1.Certificate.RevocationDetails
                .getDefaultInstance()) return this;
        if (other.revocationState_ != 0) {
          setRevocationStateValue(other.getRevocationStateValue());
        }
        if (other.hasRevocationTime()) {
          mergeRevocationTime(other.getRevocationTime());
        }
        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 8:
                {
                  revocationState_ = input.readEnum();
                  bitField0_ |= 0x00000001;
                  break;
                } // case 8
              case 18:
                {
                  input.readMessage(
                      getRevocationTimeFieldBuilder().getBuilder(), extensionRegistry);
                  bitField0_ |= 0x00000002;
                  break;
                } // case 18
              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 int revocationState_ = 0;
      /**
       *
       *
       * <pre>
       * Indicates why a
       * [Certificate][google.cloud.security.privateca.v1.Certificate] was
       * revoked.
       * </pre>
       *
       * <code>.google.cloud.security.privateca.v1.RevocationReason revocation_state = 1;</code>
       *
       * @return The enum numeric value on the wire for revocationState.
       */
      @java.lang.Override
      public int getRevocationStateValue() {
        return revocationState_;
      }
      /**
       *
       *
       * <pre>
       * Indicates why a
       * [Certificate][google.cloud.security.privateca.v1.Certificate] was
       * revoked.
       * </pre>
       *
       * <code>.google.cloud.security.privateca.v1.RevocationReason revocation_state = 1;</code>
       *
       * @param value The enum numeric value on the wire for revocationState to set.
       * @return This builder for chaining.
       */
      public Builder setRevocationStateValue(int value) {
        revocationState_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Indicates why a
       * [Certificate][google.cloud.security.privateca.v1.Certificate] was
       * revoked.
       * </pre>
       *
       * <code>.google.cloud.security.privateca.v1.RevocationReason revocation_state = 1;</code>
       *
       * @return The revocationState.
       */
      @java.lang.Override
      public com.google.cloud.security.privateca.v1.RevocationReason getRevocationState() {
        com.google.cloud.security.privateca.v1.RevocationReason result =
            com.google.cloud.security.privateca.v1.RevocationReason.forNumber(revocationState_);
        return result == null
            ? com.google.cloud.security.privateca.v1.RevocationReason.UNRECOGNIZED
            : result;
      }
      /**
       *
       *
       * <pre>
       * Indicates why a
       * [Certificate][google.cloud.security.privateca.v1.Certificate] was
       * revoked.
       * </pre>
       *
       * <code>.google.cloud.security.privateca.v1.RevocationReason revocation_state = 1;</code>
       *
       * @param value The revocationState to set.
       * @return This builder for chaining.
       */
      public Builder setRevocationState(
          com.google.cloud.security.privateca.v1.RevocationReason value) {
        if (value == null) {
          throw new NullPointerException();
        }
        bitField0_ |= 0x00000001;
        revocationState_ = value.getNumber();
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Indicates why a
       * [Certificate][google.cloud.security.privateca.v1.Certificate] was
       * revoked.
       * </pre>
       *
       * <code>.google.cloud.security.privateca.v1.RevocationReason revocation_state = 1;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearRevocationState() {
        bitField0_ = (bitField0_ & ~0x00000001);
        revocationState_ = 0;
        onChanged();
        return this;
      }

      private com.google.protobuf.Timestamp revocationTime_;
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.Timestamp,
              com.google.protobuf.Timestamp.Builder,
              com.google.protobuf.TimestampOrBuilder>
          revocationTimeBuilder_;
      /**
       *
       *
       * <pre>
       * The time at which this
       * [Certificate][google.cloud.security.privateca.v1.Certificate] was
       * revoked.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp revocation_time = 2;</code>
       *
       * @return Whether the revocationTime field is set.
       */
      public boolean hasRevocationTime() {
        return ((bitField0_ & 0x00000002) != 0);
      }
      /**
       *
       *
       * <pre>
       * The time at which this
       * [Certificate][google.cloud.security.privateca.v1.Certificate] was
       * revoked.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp revocation_time = 2;</code>
       *
       * @return The revocationTime.
       */
      public com.google.protobuf.Timestamp getRevocationTime() {
        if (revocationTimeBuilder_ == null) {
          return revocationTime_ == null
              ? com.google.protobuf.Timestamp.getDefaultInstance()
              : revocationTime_;
        } else {
          return revocationTimeBuilder_.getMessage();
        }
      }
      /**
       *
       *
       * <pre>
       * The time at which this
       * [Certificate][google.cloud.security.privateca.v1.Certificate] was
       * revoked.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp revocation_time = 2;</code>
       */
      public Builder setRevocationTime(com.google.protobuf.Timestamp value) {
        if (revocationTimeBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          revocationTime_ = value;
        } else {
          revocationTimeBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The time at which this
       * [Certificate][google.cloud.security.privateca.v1.Certificate] was
       * revoked.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp revocation_time = 2;</code>
       */
      public Builder setRevocationTime(com.google.protobuf.Timestamp.Builder builderForValue) {
        if (revocationTimeBuilder_ == null) {
          revocationTime_ = builderForValue.build();
        } else {
          revocationTimeBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The time at which this
       * [Certificate][google.cloud.security.privateca.v1.Certificate] was
       * revoked.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp revocation_time = 2;</code>
       */
      public Builder mergeRevocationTime(com.google.protobuf.Timestamp value) {
        if (revocationTimeBuilder_ == null) {
          if (((bitField0_ & 0x00000002) != 0)
              && revocationTime_ != null
              && revocationTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
            getRevocationTimeBuilder().mergeFrom(value);
          } else {
            revocationTime_ = value;
          }
        } else {
          revocationTimeBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The time at which this
       * [Certificate][google.cloud.security.privateca.v1.Certificate] was
       * revoked.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp revocation_time = 2;</code>
       */
      public Builder clearRevocationTime() {
        bitField0_ = (bitField0_ & ~0x00000002);
        revocationTime_ = null;
        if (revocationTimeBuilder_ != null) {
          revocationTimeBuilder_.dispose();
          revocationTimeBuilder_ = null;
        }
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The time at which this
       * [Certificate][google.cloud.security.privateca.v1.Certificate] was
       * revoked.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp revocation_time = 2;</code>
       */
      public com.google.protobuf.Timestamp.Builder getRevocationTimeBuilder() {
        bitField0_ |= 0x00000002;
        onChanged();
        return getRevocationTimeFieldBuilder().getBuilder();
      }
      /**
       *
       *
       * <pre>
       * The time at which this
       * [Certificate][google.cloud.security.privateca.v1.Certificate] was
       * revoked.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp revocation_time = 2;</code>
       */
      public com.google.protobuf.TimestampOrBuilder getRevocationTimeOrBuilder() {
        if (revocationTimeBuilder_ != null) {
          return revocationTimeBuilder_.getMessageOrBuilder();
        } else {
          return revocationTime_ == null
              ? com.google.protobuf.Timestamp.getDefaultInstance()
              : revocationTime_;
        }
      }
      /**
       *
       *
       * <pre>
       * The time at which this
       * [Certificate][google.cloud.security.privateca.v1.Certificate] was
       * revoked.
       * </pre>
       *
       * <code>.google.protobuf.Timestamp revocation_time = 2;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.Timestamp,
              com.google.protobuf.Timestamp.Builder,
              com.google.protobuf.TimestampOrBuilder>
          getRevocationTimeFieldBuilder() {
        if (revocationTimeBuilder_ == null) {
          revocationTimeBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.protobuf.Timestamp,
                  com.google.protobuf.Timestamp.Builder,
                  com.google.protobuf.TimestampOrBuilder>(
                  getRevocationTime(), getParentForChildren(), isClean());
          revocationTime_ = null;
        }
        return revocationTimeBuilder_;
      }

      @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.security.privateca.v1.Certificate.RevocationDetails)
    }

    // @@protoc_insertion_point(class_scope:google.cloud.security.privateca.v1.Certificate.RevocationDetails)
    private static final com.google.cloud.security.privateca.v1.Certificate.RevocationDetails
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.cloud.security.privateca.v1.Certificate.RevocationDetails();
    }

    public static com.google.cloud.security.privateca.v1.Certificate.RevocationDetails
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<RevocationDetails> PARSER =
        new com.google.protobuf.AbstractParser<RevocationDetails>() {
          @java.lang.Override
          public RevocationDetails 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<RevocationDetails> parser() {
      return PARSER;
    }

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

    @java.lang.Override
    public com.google.cloud.security.privateca.v1.Certificate.RevocationDetails
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  private int certificateConfigCase_ = 0;
  private java.lang.Object certificateConfig_;

  public enum CertificateConfigCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    PEM_CSR(2),
    CONFIG(3),
    CERTIFICATECONFIG_NOT_SET(0);
    private final int value;

    private CertificateConfigCase(int value) {
      this.value = value;
    }
    /**
     * @param value The number of the enum to look for.
     * @return The enum associated with the given number.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static CertificateConfigCase valueOf(int value) {
      return forNumber(value);
    }

    public static CertificateConfigCase forNumber(int value) {
      switch (value) {
        case 2:
          return PEM_CSR;
        case 3:
          return CONFIG;
        case 0:
          return CERTIFICATECONFIG_NOT_SET;
        default:
          return null;
      }
    }

    public int getNumber() {
      return this.value;
    }
  };

  public CertificateConfigCase getCertificateConfigCase() {
    return CertificateConfigCase.forNumber(certificateConfigCase_);
  }

  public static final int NAME_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object name_ = "";
  /**
   *
   *
   * <pre>
   * Output only. The resource name for this
   * [Certificate][google.cloud.security.privateca.v1.Certificate] in the format
   * `projects/&#42;&#47;locations/&#42;&#47;caPools/&#42;&#47;certificates/&#42;`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
   * </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>
   * Output only. The resource name for this
   * [Certificate][google.cloud.security.privateca.v1.Certificate] in the format
   * `projects/&#42;&#47;locations/&#42;&#47;caPools/&#42;&#47;certificates/&#42;`.
   * </pre>
   *
   * <code>
   * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
   * </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 PEM_CSR_FIELD_NUMBER = 2;
  /**
   *
   *
   * <pre>
   * Immutable. A pem-encoded X.509 certificate signing request (CSR).
   * </pre>
   *
   * <code>string pem_csr = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
   *
   * @return Whether the pemCsr field is set.
   */
  public boolean hasPemCsr() {
    return certificateConfigCase_ == 2;
  }
  /**
   *
   *
   * <pre>
   * Immutable. A pem-encoded X.509 certificate signing request (CSR).
   * </pre>
   *
   * <code>string pem_csr = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
   *
   * @return The pemCsr.
   */
  public java.lang.String getPemCsr() {
    java.lang.Object ref = "";
    if (certificateConfigCase_ == 2) {
      ref = certificateConfig_;
    }
    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();
      if (certificateConfigCase_ == 2) {
        certificateConfig_ = s;
      }
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Immutable. A pem-encoded X.509 certificate signing request (CSR).
   * </pre>
   *
   * <code>string pem_csr = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
   *
   * @return The bytes for pemCsr.
   */
  public com.google.protobuf.ByteString getPemCsrBytes() {
    java.lang.Object ref = "";
    if (certificateConfigCase_ == 2) {
      ref = certificateConfig_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      if (certificateConfigCase_ == 2) {
        certificateConfig_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CONFIG_FIELD_NUMBER = 3;
  /**
   *
   *
   * <pre>
   * Immutable. A description of the certificate and key that does not require
   * X.509 or ASN.1.
   * </pre>
   *
   * <code>
   * .google.cloud.security.privateca.v1.CertificateConfig config = 3 [(.google.api.field_behavior) = IMMUTABLE];
   * </code>
   *
   * @return Whether the config field is set.
   */
  @java.lang.Override
  public boolean hasConfig() {
    return certificateConfigCase_ == 3;
  }
  /**
   *
   *
   * <pre>
   * Immutable. A description of the certificate and key that does not require
   * X.509 or ASN.1.
   * </pre>
   *
   * <code>
   * .google.cloud.security.privateca.v1.CertificateConfig config = 3 [(.google.api.field_behavior) = IMMUTABLE];
   * </code>
   *
   * @return The config.
   */
  @java.lang.Override
  public com.google.cloud.security.privateca.v1.CertificateConfig getConfig() {
    if (certificateConfigCase_ == 3) {
      return (com.google.cloud.security.privateca.v1.CertificateConfig) certificateConfig_;
    }
    return com.google.cloud.security.privateca.v1.CertificateConfig.getDefaultInstance();
  }
  /**
   *
   *
   * <pre>
   * Immutable. A description of the certificate and key that does not require
   * X.509 or ASN.1.
   * </pre>
   *
   * <code>
   * .google.cloud.security.privateca.v1.CertificateConfig config = 3 [(.google.api.field_behavior) = IMMUTABLE];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.security.privateca.v1.CertificateConfigOrBuilder getConfigOrBuilder() {
    if (certificateConfigCase_ == 3) {
      return (com.google.cloud.security.privateca.v1.CertificateConfig) certificateConfig_;
    }
    return com.google.cloud.security.privateca.v1.CertificateConfig.getDefaultInstance();
  }

  public static final int ISSUER_CERTIFICATE_AUTHORITY_FIELD_NUMBER = 4;

  @SuppressWarnings("serial")
  private volatile java.lang.Object issuerCertificateAuthority_ = "";
  /**
   *
   *
   * <pre>
   * Output only. The resource name of the issuing
   * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
   * in the format `projects/&#42;&#47;locations/&#42;&#47;caPools/&#42;&#47;certificateAuthorities/&#42;`.
   * </pre>
   *
   * <code>
   * string issuer_certificate_authority = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The issuerCertificateAuthority.
   */
  @java.lang.Override
  public java.lang.String getIssuerCertificateAuthority() {
    java.lang.Object ref = issuerCertificateAuthority_;
    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();
      issuerCertificateAuthority_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Output only. The resource name of the issuing
   * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
   * in the format `projects/&#42;&#47;locations/&#42;&#47;caPools/&#42;&#47;certificateAuthorities/&#42;`.
   * </pre>
   *
   * <code>
   * string issuer_certificate_authority = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for issuerCertificateAuthority.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getIssuerCertificateAuthorityBytes() {
    java.lang.Object ref = issuerCertificateAuthority_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      issuerCertificateAuthority_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int LIFETIME_FIELD_NUMBER = 5;
  private com.google.protobuf.Duration lifetime_;
  /**
   *
   *
   * <pre>
   * Required. Immutable. The desired lifetime of a certificate. Used to create
   * the "not_before_time" and "not_after_time" fields inside an X.509
   * certificate. Note that the lifetime may be truncated if it would extend
   * past the life of any certificate authority in the issuing chain.
   * </pre>
   *
   * <code>
   * .google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
   * </code>
   *
   * @return Whether the lifetime field is set.
   */
  @java.lang.Override
  public boolean hasLifetime() {
    return lifetime_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required. Immutable. The desired lifetime of a certificate. Used to create
   * the "not_before_time" and "not_after_time" fields inside an X.509
   * certificate. Note that the lifetime may be truncated if it would extend
   * past the life of any certificate authority in the issuing chain.
   * </pre>
   *
   * <code>
   * .google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
   * </code>
   *
   * @return The lifetime.
   */
  @java.lang.Override
  public com.google.protobuf.Duration getLifetime() {
    return lifetime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : lifetime_;
  }
  /**
   *
   *
   * <pre>
   * Required. Immutable. The desired lifetime of a certificate. Used to create
   * the "not_before_time" and "not_after_time" fields inside an X.509
   * certificate. Note that the lifetime may be truncated if it would extend
   * past the life of any certificate authority in the issuing chain.
   * </pre>
   *
   * <code>
   * .google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
   * </code>
   */
  @java.lang.Override
  public com.google.protobuf.DurationOrBuilder getLifetimeOrBuilder() {
    return lifetime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : lifetime_;
  }

  public static final int CERTIFICATE_TEMPLATE_FIELD_NUMBER = 6;

  @SuppressWarnings("serial")
  private volatile java.lang.Object certificateTemplate_ = "";
  /**
   *
   *
   * <pre>
   * Immutable. The resource name for a
   * [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
   * used to issue this certificate, in the format
   * `projects/&#42;&#47;locations/&#42;&#47;certificateTemplates/&#42;`.
   * If this is specified, the caller must have the necessary permission to
   * use this template. If this is omitted, no template will be used.
   * This template must be in the same location as the
   * [Certificate][google.cloud.security.privateca.v1.Certificate].
   * </pre>
   *
   * <code>
   * string certificate_template = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The certificateTemplate.
   */
  @java.lang.Override
  public java.lang.String getCertificateTemplate() {
    java.lang.Object ref = certificateTemplate_;
    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();
      certificateTemplate_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Immutable. The resource name for a
   * [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
   * used to issue this certificate, in the format
   * `projects/&#42;&#47;locations/&#42;&#47;certificateTemplates/&#42;`.
   * If this is specified, the caller must have the necessary permission to
   * use this template. If this is omitted, no template will be used.
   * This template must be in the same location as the
   * [Certificate][google.cloud.security.privateca.v1.Certificate].
   * </pre>
   *
   * <code>
   * string certificate_template = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for certificateTemplate.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getCertificateTemplateBytes() {
    java.lang.Object ref = certificateTemplate_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      certificateTemplate_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SUBJECT_MODE_FIELD_NUMBER = 7;
  private int subjectMode_ = 0;
  /**
   *
   *
   * <pre>
   * Immutable. Specifies how the
   * [Certificate][google.cloud.security.privateca.v1.Certificate]'s identity
   * fields are to be decided. If this is omitted, the `DEFAULT` subject mode
   * will be used.
   * </pre>
   *
   * <code>
   * .google.cloud.security.privateca.v1.SubjectRequestMode subject_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
   * </code>
   *
   * @return The enum numeric value on the wire for subjectMode.
   */
  @java.lang.Override
  public int getSubjectModeValue() {
    return subjectMode_;
  }
  /**
   *
   *
   * <pre>
   * Immutable. Specifies how the
   * [Certificate][google.cloud.security.privateca.v1.Certificate]'s identity
   * fields are to be decided. If this is omitted, the `DEFAULT` subject mode
   * will be used.
   * </pre>
   *
   * <code>
   * .google.cloud.security.privateca.v1.SubjectRequestMode subject_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
   * </code>
   *
   * @return The subjectMode.
   */
  @java.lang.Override
  public com.google.cloud.security.privateca.v1.SubjectRequestMode getSubjectMode() {
    com.google.cloud.security.privateca.v1.SubjectRequestMode result =
        com.google.cloud.security.privateca.v1.SubjectRequestMode.forNumber(subjectMode_);
    return result == null
        ? com.google.cloud.security.privateca.v1.SubjectRequestMode.UNRECOGNIZED
        : result;
  }

  public static final int REVOCATION_DETAILS_FIELD_NUMBER = 8;
  private com.google.cloud.security.privateca.v1.Certificate.RevocationDetails revocationDetails_;
  /**
   *
   *
   * <pre>
   * Output only. Details regarding the revocation of this
   * [Certificate][google.cloud.security.privateca.v1.Certificate]. This
   * [Certificate][google.cloud.security.privateca.v1.Certificate] is considered
   * revoked if and only if this field is present.
   * </pre>
   *
   * <code>
   * .google.cloud.security.privateca.v1.Certificate.RevocationDetails revocation_details = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return Whether the revocationDetails field is set.
   */
  @java.lang.Override
  public boolean hasRevocationDetails() {
    return revocationDetails_ != null;
  }
  /**
   *
   *
   * <pre>
   * Output only. Details regarding the revocation of this
   * [Certificate][google.cloud.security.privateca.v1.Certificate]. This
   * [Certificate][google.cloud.security.privateca.v1.Certificate] is considered
   * revoked if and only if this field is present.
   * </pre>
   *
   * <code>
   * .google.cloud.security.privateca.v1.Certificate.RevocationDetails revocation_details = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The revocationDetails.
   */
  @java.lang.Override
  public com.google.cloud.security.privateca.v1.Certificate.RevocationDetails
      getRevocationDetails() {
    return revocationDetails_ == null
        ? com.google.cloud.security.privateca.v1.Certificate.RevocationDetails.getDefaultInstance()
        : revocationDetails_;
  }
  /**
   *
   *
   * <pre>
   * Output only. Details regarding the revocation of this
   * [Certificate][google.cloud.security.privateca.v1.Certificate]. This
   * [Certificate][google.cloud.security.privateca.v1.Certificate] is considered
   * revoked if and only if this field is present.
   * </pre>
   *
   * <code>
   * .google.cloud.security.privateca.v1.Certificate.RevocationDetails revocation_details = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.security.privateca.v1.Certificate.RevocationDetailsOrBuilder
      getRevocationDetailsOrBuilder() {
    return revocationDetails_ == null
        ? com.google.cloud.security.privateca.v1.Certificate.RevocationDetails.getDefaultInstance()
        : revocationDetails_;
  }

  public static final int PEM_CERTIFICATE_FIELD_NUMBER = 9;

  @SuppressWarnings("serial")
  private volatile java.lang.Object pemCertificate_ = "";
  /**
   *
   *
   * <pre>
   * Output only. The pem-encoded, signed X.509 certificate.
   * </pre>
   *
   * <code>string pem_certificate = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The pemCertificate.
   */
  @java.lang.Override
  public java.lang.String getPemCertificate() {
    java.lang.Object ref = pemCertificate_;
    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();
      pemCertificate_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Output only. The pem-encoded, signed X.509 certificate.
   * </pre>
   *
   * <code>string pem_certificate = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The bytes for pemCertificate.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getPemCertificateBytes() {
    java.lang.Object ref = pemCertificate_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      pemCertificate_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CERTIFICATE_DESCRIPTION_FIELD_NUMBER = 10;
  private com.google.cloud.security.privateca.v1.CertificateDescription certificateDescription_;
  /**
   *
   *
   * <pre>
   * Output only. A structured description of the issued X.509 certificate.
   * </pre>
   *
   * <code>
   * .google.cloud.security.privateca.v1.CertificateDescription certificate_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return Whether the certificateDescription field is set.
   */
  @java.lang.Override
  public boolean hasCertificateDescription() {
    return certificateDescription_ != null;
  }
  /**
   *
   *
   * <pre>
   * Output only. A structured description of the issued X.509 certificate.
   * </pre>
   *
   * <code>
   * .google.cloud.security.privateca.v1.CertificateDescription certificate_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The certificateDescription.
   */
  @java.lang.Override
  public com.google.cloud.security.privateca.v1.CertificateDescription getCertificateDescription() {
    return certificateDescription_ == null
        ? com.google.cloud.security.privateca.v1.CertificateDescription.getDefaultInstance()
        : certificateDescription_;
  }
  /**
   *
   *
   * <pre>
   * Output only. A structured description of the issued X.509 certificate.
   * </pre>
   *
   * <code>
   * .google.cloud.security.privateca.v1.CertificateDescription certificate_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.security.privateca.v1.CertificateDescriptionOrBuilder
      getCertificateDescriptionOrBuilder() {
    return certificateDescription_ == null
        ? com.google.cloud.security.privateca.v1.CertificateDescription.getDefaultInstance()
        : certificateDescription_;
  }

  public static final int PEM_CERTIFICATE_CHAIN_FIELD_NUMBER = 11;

  @SuppressWarnings("serial")
  private com.google.protobuf.LazyStringList pemCertificateChain_;
  /**
   *
   *
   * <pre>
   * Output only. The chain that may be used to verify the X.509 certificate.
   * Expected to be in issuer-to-root order according to RFC 5246.
   * </pre>
   *
   * <code>repeated string pem_certificate_chain = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return A list containing the pemCertificateChain.
   */
  public com.google.protobuf.ProtocolStringList getPemCertificateChainList() {
    return pemCertificateChain_;
  }
  /**
   *
   *
   * <pre>
   * Output only. The chain that may be used to verify the X.509 certificate.
   * Expected to be in issuer-to-root order according to RFC 5246.
   * </pre>
   *
   * <code>repeated string pem_certificate_chain = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The count of pemCertificateChain.
   */
  public int getPemCertificateChainCount() {
    return pemCertificateChain_.size();
  }
  /**
   *
   *
   * <pre>
   * Output only. The chain that may be used to verify the X.509 certificate.
   * Expected to be in issuer-to-root order according to RFC 5246.
   * </pre>
   *
   * <code>repeated string pem_certificate_chain = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @param index The index of the element to return.
   * @return The pemCertificateChain at the given index.
   */
  public java.lang.String getPemCertificateChain(int index) {
    return pemCertificateChain_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Output only. The chain that may be used to verify the X.509 certificate.
   * Expected to be in issuer-to-root order according to RFC 5246.
   * </pre>
   *
   * <code>repeated string pem_certificate_chain = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @param index The index of the value to return.
   * @return The bytes of the pemCertificateChain at the given index.
   */
  public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) {
    return pemCertificateChain_.getByteString(index);
  }

  public static final int CREATE_TIME_FIELD_NUMBER = 12;
  private com.google.protobuf.Timestamp createTime_;
  /**
   *
   *
   * <pre>
   * Output only. The time at which this
   * [Certificate][google.cloud.security.privateca.v1.Certificate] was created.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return Whether the createTime field is set.
   */
  @java.lang.Override
  public boolean hasCreateTime() {
    return createTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time at which this
   * [Certificate][google.cloud.security.privateca.v1.Certificate] was created.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The createTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getCreateTime() {
    return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time at which this
   * [Certificate][google.cloud.security.privateca.v1.Certificate] was created.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
    return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
  }

  public static final int UPDATE_TIME_FIELD_NUMBER = 13;
  private com.google.protobuf.Timestamp updateTime_;
  /**
   *
   *
   * <pre>
   * Output only. The time at which this
   * [Certificate][google.cloud.security.privateca.v1.Certificate] was updated.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return Whether the updateTime field is set.
   */
  @java.lang.Override
  public boolean hasUpdateTime() {
    return updateTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time at which this
   * [Certificate][google.cloud.security.privateca.v1.Certificate] was updated.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The updateTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getUpdateTime() {
    return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_;
  }
  /**
   *
   *
   * <pre>
   * Output only. The time at which this
   * [Certificate][google.cloud.security.privateca.v1.Certificate] was updated.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
    return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_;
  }

  public static final int LABELS_FIELD_NUMBER = 14;

  private static final class LabelsDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry =
        com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(
            com.google.cloud.security.privateca.v1.PrivateCaResourcesProto
                .internal_static_google_cloud_security_privateca_v1_Certificate_LabelsEntry_descriptor,
            com.google.protobuf.WireFormat.FieldType.STRING,
            "",
            com.google.protobuf.WireFormat.FieldType.STRING,
            "");
  }

  @SuppressWarnings("serial")
  private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_;

  private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
    if (labels_ == null) {
      return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
    }
    return labels_;
  }

  public int getLabelsCount() {
    return internalGetLabels().getMap().size();
  }
  /**
   *
   *
   * <pre>
   * Optional. Labels with user-defined metadata.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  @java.lang.Override
  public boolean containsLabels(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    return internalGetLabels().getMap().containsKey(key);
  }
  /** Use {@link #getLabelsMap()} instead. */
  @java.lang.Override
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getLabels() {
    return getLabelsMap();
  }
  /**
   *
   *
   * <pre>
   * Optional. Labels with user-defined metadata.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  @java.lang.Override
  public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
    return internalGetLabels().getMap();
  }
  /**
   *
   *
   * <pre>
   * Optional. Labels with user-defined metadata.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  @java.lang.Override
  public /* nullable */ java.lang.String getLabelsOrDefault(
      java.lang.String key,
      /* nullable */
      java.lang.String defaultValue) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   *
   *
   * <pre>
   * Optional. Labels with user-defined metadata.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  @java.lang.Override
  public java.lang.String getLabelsOrThrow(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (certificateConfigCase_ == 2) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, certificateConfig_);
    }
    if (certificateConfigCase_ == 3) {
      output.writeMessage(
          3, (com.google.cloud.security.privateca.v1.CertificateConfig) certificateConfig_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(issuerCertificateAuthority_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, issuerCertificateAuthority_);
    }
    if (lifetime_ != null) {
      output.writeMessage(5, getLifetime());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(certificateTemplate_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, certificateTemplate_);
    }
    if (subjectMode_
        != com.google.cloud.security.privateca.v1.SubjectRequestMode
            .SUBJECT_REQUEST_MODE_UNSPECIFIED
            .getNumber()) {
      output.writeEnum(7, subjectMode_);
    }
    if (revocationDetails_ != null) {
      output.writeMessage(8, getRevocationDetails());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pemCertificate_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 9, pemCertificate_);
    }
    if (certificateDescription_ != null) {
      output.writeMessage(10, getCertificateDescription());
    }
    for (int i = 0; i < pemCertificateChain_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(
          output, 11, pemCertificateChain_.getRaw(i));
    }
    if (createTime_ != null) {
      output.writeMessage(12, getCreateTime());
    }
    if (updateTime_ != null) {
      output.writeMessage(13, getUpdateTime());
    }
    com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 14);
    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 (certificateConfigCase_ == 2) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, certificateConfig_);
    }
    if (certificateConfigCase_ == 3) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              3, (com.google.cloud.security.privateca.v1.CertificateConfig) certificateConfig_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(issuerCertificateAuthority_)) {
      size +=
          com.google.protobuf.GeneratedMessageV3.computeStringSize(4, issuerCertificateAuthority_);
    }
    if (lifetime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getLifetime());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(certificateTemplate_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, certificateTemplate_);
    }
    if (subjectMode_
        != com.google.cloud.security.privateca.v1.SubjectRequestMode
            .SUBJECT_REQUEST_MODE_UNSPECIFIED
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, subjectMode_);
    }
    if (revocationDetails_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getRevocationDetails());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pemCertificate_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, pemCertificate_);
    }
    if (certificateDescription_ != null) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(10, getCertificateDescription());
    }
    {
      int dataSize = 0;
      for (int i = 0; i < pemCertificateChain_.size(); i++) {
        dataSize += computeStringSizeNoTag(pemCertificateChain_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getPemCertificateChainList().size();
    }
    if (createTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getCreateTime());
    }
    if (updateTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getUpdateTime());
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
        internalGetLabels().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
          LabelsDefaultEntryHolder.defaultEntry
              .newBuilderForType()
              .setKey(entry.getKey())
              .setValue(entry.getValue())
              .build();
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, labels__);
    }
    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.security.privateca.v1.Certificate)) {
      return super.equals(obj);
    }
    com.google.cloud.security.privateca.v1.Certificate other =
        (com.google.cloud.security.privateca.v1.Certificate) obj;

    if (!getName().equals(other.getName())) return false;
    if (!getIssuerCertificateAuthority().equals(other.getIssuerCertificateAuthority()))
      return false;
    if (hasLifetime() != other.hasLifetime()) return false;
    if (hasLifetime()) {
      if (!getLifetime().equals(other.getLifetime())) return false;
    }
    if (!getCertificateTemplate().equals(other.getCertificateTemplate())) return false;
    if (subjectMode_ != other.subjectMode_) return false;
    if (hasRevocationDetails() != other.hasRevocationDetails()) return false;
    if (hasRevocationDetails()) {
      if (!getRevocationDetails().equals(other.getRevocationDetails())) return false;
    }
    if (!getPemCertificate().equals(other.getPemCertificate())) return false;
    if (hasCertificateDescription() != other.hasCertificateDescription()) return false;
    if (hasCertificateDescription()) {
      if (!getCertificateDescription().equals(other.getCertificateDescription())) return false;
    }
    if (!getPemCertificateChainList().equals(other.getPemCertificateChainList())) return false;
    if (hasCreateTime() != other.hasCreateTime()) return false;
    if (hasCreateTime()) {
      if (!getCreateTime().equals(other.getCreateTime())) return false;
    }
    if (hasUpdateTime() != other.hasUpdateTime()) return false;
    if (hasUpdateTime()) {
      if (!getUpdateTime().equals(other.getUpdateTime())) return false;
    }
    if (!internalGetLabels().equals(other.internalGetLabels())) return false;
    if (!getCertificateConfigCase().equals(other.getCertificateConfigCase())) return false;
    switch (certificateConfigCase_) {
      case 2:
        if (!getPemCsr().equals(other.getPemCsr())) return false;
        break;
      case 3:
        if (!getConfig().equals(other.getConfig())) return false;
        break;
      case 0:
      default:
    }
    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) + ISSUER_CERTIFICATE_AUTHORITY_FIELD_NUMBER;
    hash = (53 * hash) + getIssuerCertificateAuthority().hashCode();
    if (hasLifetime()) {
      hash = (37 * hash) + LIFETIME_FIELD_NUMBER;
      hash = (53 * hash) + getLifetime().hashCode();
    }
    hash = (37 * hash) + CERTIFICATE_TEMPLATE_FIELD_NUMBER;
    hash = (53 * hash) + getCertificateTemplate().hashCode();
    hash = (37 * hash) + SUBJECT_MODE_FIELD_NUMBER;
    hash = (53 * hash) + subjectMode_;
    if (hasRevocationDetails()) {
      hash = (37 * hash) + REVOCATION_DETAILS_FIELD_NUMBER;
      hash = (53 * hash) + getRevocationDetails().hashCode();
    }
    hash = (37 * hash) + PEM_CERTIFICATE_FIELD_NUMBER;
    hash = (53 * hash) + getPemCertificate().hashCode();
    if (hasCertificateDescription()) {
      hash = (37 * hash) + CERTIFICATE_DESCRIPTION_FIELD_NUMBER;
      hash = (53 * hash) + getCertificateDescription().hashCode();
    }
    if (getPemCertificateChainCount() > 0) {
      hash = (37 * hash) + PEM_CERTIFICATE_CHAIN_FIELD_NUMBER;
      hash = (53 * hash) + getPemCertificateChainList().hashCode();
    }
    if (hasCreateTime()) {
      hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getCreateTime().hashCode();
    }
    if (hasUpdateTime()) {
      hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getUpdateTime().hashCode();
    }
    if (!internalGetLabels().getMap().isEmpty()) {
      hash = (37 * hash) + LABELS_FIELD_NUMBER;
      hash = (53 * hash) + internalGetLabels().hashCode();
    }
    switch (certificateConfigCase_) {
      case 2:
        hash = (37 * hash) + PEM_CSR_FIELD_NUMBER;
        hash = (53 * hash) + getPemCsr().hashCode();
        break;
      case 3:
        hash = (37 * hash) + CONFIG_FIELD_NUMBER;
        hash = (53 * hash) + getConfig().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

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

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

  public static com.google.cloud.security.privateca.v1.Certificate 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.security.privateca.v1.Certificate 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 [Certificate][google.cloud.security.privateca.v1.Certificate] corresponds
   * to a signed X.509 certificate issued by a
   * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority].
   * </pre>
   *
   * Protobuf type {@code google.cloud.security.privateca.v1.Certificate}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.security.privateca.v1.Certificate)
      com.google.cloud.security.privateca.v1.CertificateOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.security.privateca.v1.PrivateCaResourcesProto
          .internal_static_google_cloud_security_privateca_v1_Certificate_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(int number) {
      switch (number) {
        case 14:
          return internalGetLabels();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
      switch (number) {
        case 14:
          return internalGetMutableLabels();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.security.privateca.v1.PrivateCaResourcesProto
          .internal_static_google_cloud_security_privateca_v1_Certificate_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.security.privateca.v1.Certificate.class,
              com.google.cloud.security.privateca.v1.Certificate.Builder.class);
    }

    // Construct using com.google.cloud.security.privateca.v1.Certificate.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      name_ = "";
      if (configBuilder_ != null) {
        configBuilder_.clear();
      }
      issuerCertificateAuthority_ = "";
      lifetime_ = null;
      if (lifetimeBuilder_ != null) {
        lifetimeBuilder_.dispose();
        lifetimeBuilder_ = null;
      }
      certificateTemplate_ = "";
      subjectMode_ = 0;
      revocationDetails_ = null;
      if (revocationDetailsBuilder_ != null) {
        revocationDetailsBuilder_.dispose();
        revocationDetailsBuilder_ = null;
      }
      pemCertificate_ = "";
      certificateDescription_ = null;
      if (certificateDescriptionBuilder_ != null) {
        certificateDescriptionBuilder_.dispose();
        certificateDescriptionBuilder_ = null;
      }
      pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000400);
      createTime_ = null;
      if (createTimeBuilder_ != null) {
        createTimeBuilder_.dispose();
        createTimeBuilder_ = null;
      }
      updateTime_ = null;
      if (updateTimeBuilder_ != null) {
        updateTimeBuilder_.dispose();
        updateTimeBuilder_ = null;
      }
      internalGetMutableLabels().clear();
      certificateConfigCase_ = 0;
      certificateConfig_ = null;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.security.privateca.v1.PrivateCaResourcesProto
          .internal_static_google_cloud_security_privateca_v1_Certificate_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.security.privateca.v1.Certificate getDefaultInstanceForType() {
      return com.google.cloud.security.privateca.v1.Certificate.getDefaultInstance();
    }

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

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

    private void buildPartialRepeatedFields(
        com.google.cloud.security.privateca.v1.Certificate result) {
      if (((bitField0_ & 0x00000400) != 0)) {
        pemCertificateChain_ = pemCertificateChain_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000400);
      }
      result.pemCertificateChain_ = pemCertificateChain_;
    }

    private void buildPartial0(com.google.cloud.security.privateca.v1.Certificate result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.name_ = name_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.issuerCertificateAuthority_ = issuerCertificateAuthority_;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.lifetime_ = lifetimeBuilder_ == null ? lifetime_ : lifetimeBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.certificateTemplate_ = certificateTemplate_;
      }
      if (((from_bitField0_ & 0x00000040) != 0)) {
        result.subjectMode_ = subjectMode_;
      }
      if (((from_bitField0_ & 0x00000080) != 0)) {
        result.revocationDetails_ =
            revocationDetailsBuilder_ == null
                ? revocationDetails_
                : revocationDetailsBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000100) != 0)) {
        result.pemCertificate_ = pemCertificate_;
      }
      if (((from_bitField0_ & 0x00000200) != 0)) {
        result.certificateDescription_ =
            certificateDescriptionBuilder_ == null
                ? certificateDescription_
                : certificateDescriptionBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000800) != 0)) {
        result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build();
      }
      if (((from_bitField0_ & 0x00001000) != 0)) {
        result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build();
      }
      if (((from_bitField0_ & 0x00002000) != 0)) {
        result.labels_ = internalGetLabels();
        result.labels_.makeImmutable();
      }
    }

    private void buildPartialOneofs(com.google.cloud.security.privateca.v1.Certificate result) {
      result.certificateConfigCase_ = certificateConfigCase_;
      result.certificateConfig_ = this.certificateConfig_;
      if (certificateConfigCase_ == 3 && configBuilder_ != null) {
        result.certificateConfig_ = configBuilder_.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.security.privateca.v1.Certificate) {
        return mergeFrom((com.google.cloud.security.privateca.v1.Certificate) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.security.privateca.v1.Certificate other) {
      if (other == com.google.cloud.security.privateca.v1.Certificate.getDefaultInstance())
        return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getIssuerCertificateAuthority().isEmpty()) {
        issuerCertificateAuthority_ = other.issuerCertificateAuthority_;
        bitField0_ |= 0x00000008;
        onChanged();
      }
      if (other.hasLifetime()) {
        mergeLifetime(other.getLifetime());
      }
      if (!other.getCertificateTemplate().isEmpty()) {
        certificateTemplate_ = other.certificateTemplate_;
        bitField0_ |= 0x00000020;
        onChanged();
      }
      if (other.subjectMode_ != 0) {
        setSubjectModeValue(other.getSubjectModeValue());
      }
      if (other.hasRevocationDetails()) {
        mergeRevocationDetails(other.getRevocationDetails());
      }
      if (!other.getPemCertificate().isEmpty()) {
        pemCertificate_ = other.pemCertificate_;
        bitField0_ |= 0x00000100;
        onChanged();
      }
      if (other.hasCertificateDescription()) {
        mergeCertificateDescription(other.getCertificateDescription());
      }
      if (!other.pemCertificateChain_.isEmpty()) {
        if (pemCertificateChain_.isEmpty()) {
          pemCertificateChain_ = other.pemCertificateChain_;
          bitField0_ = (bitField0_ & ~0x00000400);
        } else {
          ensurePemCertificateChainIsMutable();
          pemCertificateChain_.addAll(other.pemCertificateChain_);
        }
        onChanged();
      }
      if (other.hasCreateTime()) {
        mergeCreateTime(other.getCreateTime());
      }
      if (other.hasUpdateTime()) {
        mergeUpdateTime(other.getUpdateTime());
      }
      internalGetMutableLabels().mergeFrom(other.internalGetLabels());
      bitField0_ |= 0x00002000;
      switch (other.getCertificateConfigCase()) {
        case PEM_CSR:
          {
            certificateConfigCase_ = 2;
            certificateConfig_ = other.certificateConfig_;
            onChanged();
            break;
          }
        case CONFIG:
          {
            mergeConfig(other.getConfig());
            break;
          }
        case CERTIFICATECONFIG_NOT_SET:
          {
            break;
          }
      }
      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:
              {
                java.lang.String s = input.readStringRequireUtf8();
                certificateConfigCase_ = 2;
                certificateConfig_ = s;
                break;
              } // case 18
            case 26:
              {
                input.readMessage(getConfigFieldBuilder().getBuilder(), extensionRegistry);
                certificateConfigCase_ = 3;
                break;
              } // case 26
            case 34:
              {
                issuerCertificateAuthority_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000008;
                break;
              } // case 34
            case 42:
              {
                input.readMessage(getLifetimeFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000010;
                break;
              } // case 42
            case 50:
              {
                certificateTemplate_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000020;
                break;
              } // case 50
            case 56:
              {
                subjectMode_ = input.readEnum();
                bitField0_ |= 0x00000040;
                break;
              } // case 56
            case 66:
              {
                input.readMessage(
                    getRevocationDetailsFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000080;
                break;
              } // case 66
            case 74:
              {
                pemCertificate_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000100;
                break;
              } // case 74
            case 82:
              {
                input.readMessage(
                    getCertificateDescriptionFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000200;
                break;
              } // case 82
            case 90:
              {
                java.lang.String s = input.readStringRequireUtf8();
                ensurePemCertificateChainIsMutable();
                pemCertificateChain_.add(s);
                break;
              } // case 90
            case 98:
              {
                input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000800;
                break;
              } // case 98
            case 106:
              {
                input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00001000;
                break;
              } // case 106
            case 114:
              {
                com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
                    input.readMessage(
                        LabelsDefaultEntryHolder.defaultEntry.getParserForType(),
                        extensionRegistry);
                internalGetMutableLabels()
                    .getMutableMap()
                    .put(labels__.getKey(), labels__.getValue());
                bitField0_ |= 0x00002000;
                break;
              } // case 114
            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 certificateConfigCase_ = 0;
    private java.lang.Object certificateConfig_;

    public CertificateConfigCase getCertificateConfigCase() {
      return CertificateConfigCase.forNumber(certificateConfigCase_);
    }

    public Builder clearCertificateConfig() {
      certificateConfigCase_ = 0;
      certificateConfig_ = null;
      onChanged();
      return this;
    }

    private int bitField0_;

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * Output only. The resource name for this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] in the format
     * `projects/&#42;&#47;locations/&#42;&#47;caPools/&#42;&#47;certificates/&#42;`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
     * </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>
     * Output only. The resource name for this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] in the format
     * `projects/&#42;&#47;locations/&#42;&#47;caPools/&#42;&#47;certificates/&#42;`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
     * </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>
     * Output only. The resource name for this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] in the format
     * `projects/&#42;&#47;locations/&#42;&#47;caPools/&#42;&#47;certificates/&#42;`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
     * </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>
     * Output only. The resource name for this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] in the format
     * `projects/&#42;&#47;locations/&#42;&#47;caPools/&#42;&#47;certificates/&#42;`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {
      name_ = getDefaultInstance().getName();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The resource name for this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] in the format
     * `projects/&#42;&#47;locations/&#42;&#47;caPools/&#42;&#47;certificates/&#42;`.
     * </pre>
     *
     * <code>
     * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
     * </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;
    }

    /**
     *
     *
     * <pre>
     * Immutable. A pem-encoded X.509 certificate signing request (CSR).
     * </pre>
     *
     * <code>string pem_csr = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return Whether the pemCsr field is set.
     */
    @java.lang.Override
    public boolean hasPemCsr() {
      return certificateConfigCase_ == 2;
    }
    /**
     *
     *
     * <pre>
     * Immutable. A pem-encoded X.509 certificate signing request (CSR).
     * </pre>
     *
     * <code>string pem_csr = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return The pemCsr.
     */
    @java.lang.Override
    public java.lang.String getPemCsr() {
      java.lang.Object ref = "";
      if (certificateConfigCase_ == 2) {
        ref = certificateConfig_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (certificateConfigCase_ == 2) {
          certificateConfig_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. A pem-encoded X.509 certificate signing request (CSR).
     * </pre>
     *
     * <code>string pem_csr = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return The bytes for pemCsr.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getPemCsrBytes() {
      java.lang.Object ref = "";
      if (certificateConfigCase_ == 2) {
        ref = certificateConfig_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        if (certificateConfigCase_ == 2) {
          certificateConfig_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. A pem-encoded X.509 certificate signing request (CSR).
     * </pre>
     *
     * <code>string pem_csr = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param value The pemCsr to set.
     * @return This builder for chaining.
     */
    public Builder setPemCsr(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      certificateConfigCase_ = 2;
      certificateConfig_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. A pem-encoded X.509 certificate signing request (CSR).
     * </pre>
     *
     * <code>string pem_csr = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPemCsr() {
      if (certificateConfigCase_ == 2) {
        certificateConfigCase_ = 0;
        certificateConfig_ = null;
        onChanged();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. A pem-encoded X.509 certificate signing request (CSR).
     * </pre>
     *
     * <code>string pem_csr = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param value The bytes for pemCsr to set.
     * @return This builder for chaining.
     */
    public Builder setPemCsrBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      certificateConfigCase_ = 2;
      certificateConfig_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.security.privateca.v1.CertificateConfig,
            com.google.cloud.security.privateca.v1.CertificateConfig.Builder,
            com.google.cloud.security.privateca.v1.CertificateConfigOrBuilder>
        configBuilder_;
    /**
     *
     *
     * <pre>
     * Immutable. A description of the certificate and key that does not require
     * X.509 or ASN.1.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateConfig config = 3 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     *
     * @return Whether the config field is set.
     */
    @java.lang.Override
    public boolean hasConfig() {
      return certificateConfigCase_ == 3;
    }
    /**
     *
     *
     * <pre>
     * Immutable. A description of the certificate and key that does not require
     * X.509 or ASN.1.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateConfig config = 3 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     *
     * @return The config.
     */
    @java.lang.Override
    public com.google.cloud.security.privateca.v1.CertificateConfig getConfig() {
      if (configBuilder_ == null) {
        if (certificateConfigCase_ == 3) {
          return (com.google.cloud.security.privateca.v1.CertificateConfig) certificateConfig_;
        }
        return com.google.cloud.security.privateca.v1.CertificateConfig.getDefaultInstance();
      } else {
        if (certificateConfigCase_ == 3) {
          return configBuilder_.getMessage();
        }
        return com.google.cloud.security.privateca.v1.CertificateConfig.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. A description of the certificate and key that does not require
     * X.509 or ASN.1.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateConfig config = 3 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder setConfig(com.google.cloud.security.privateca.v1.CertificateConfig value) {
      if (configBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        certificateConfig_ = value;
        onChanged();
      } else {
        configBuilder_.setMessage(value);
      }
      certificateConfigCase_ = 3;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. A description of the certificate and key that does not require
     * X.509 or ASN.1.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateConfig config = 3 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder setConfig(
        com.google.cloud.security.privateca.v1.CertificateConfig.Builder builderForValue) {
      if (configBuilder_ == null) {
        certificateConfig_ = builderForValue.build();
        onChanged();
      } else {
        configBuilder_.setMessage(builderForValue.build());
      }
      certificateConfigCase_ = 3;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. A description of the certificate and key that does not require
     * X.509 or ASN.1.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateConfig config = 3 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder mergeConfig(com.google.cloud.security.privateca.v1.CertificateConfig value) {
      if (configBuilder_ == null) {
        if (certificateConfigCase_ == 3
            && certificateConfig_
                != com.google.cloud.security.privateca.v1.CertificateConfig.getDefaultInstance()) {
          certificateConfig_ =
              com.google.cloud.security.privateca.v1.CertificateConfig.newBuilder(
                      (com.google.cloud.security.privateca.v1.CertificateConfig) certificateConfig_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          certificateConfig_ = value;
        }
        onChanged();
      } else {
        if (certificateConfigCase_ == 3) {
          configBuilder_.mergeFrom(value);
        } else {
          configBuilder_.setMessage(value);
        }
      }
      certificateConfigCase_ = 3;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. A description of the certificate and key that does not require
     * X.509 or ASN.1.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateConfig config = 3 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder clearConfig() {
      if (configBuilder_ == null) {
        if (certificateConfigCase_ == 3) {
          certificateConfigCase_ = 0;
          certificateConfig_ = null;
          onChanged();
        }
      } else {
        if (certificateConfigCase_ == 3) {
          certificateConfigCase_ = 0;
          certificateConfig_ = null;
        }
        configBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. A description of the certificate and key that does not require
     * X.509 or ASN.1.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateConfig config = 3 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public com.google.cloud.security.privateca.v1.CertificateConfig.Builder getConfigBuilder() {
      return getConfigFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Immutable. A description of the certificate and key that does not require
     * X.509 or ASN.1.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateConfig config = 3 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    @java.lang.Override
    public com.google.cloud.security.privateca.v1.CertificateConfigOrBuilder getConfigOrBuilder() {
      if ((certificateConfigCase_ == 3) && (configBuilder_ != null)) {
        return configBuilder_.getMessageOrBuilder();
      } else {
        if (certificateConfigCase_ == 3) {
          return (com.google.cloud.security.privateca.v1.CertificateConfig) certificateConfig_;
        }
        return com.google.cloud.security.privateca.v1.CertificateConfig.getDefaultInstance();
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. A description of the certificate and key that does not require
     * X.509 or ASN.1.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateConfig config = 3 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.security.privateca.v1.CertificateConfig,
            com.google.cloud.security.privateca.v1.CertificateConfig.Builder,
            com.google.cloud.security.privateca.v1.CertificateConfigOrBuilder>
        getConfigFieldBuilder() {
      if (configBuilder_ == null) {
        if (!(certificateConfigCase_ == 3)) {
          certificateConfig_ =
              com.google.cloud.security.privateca.v1.CertificateConfig.getDefaultInstance();
        }
        configBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.security.privateca.v1.CertificateConfig,
                com.google.cloud.security.privateca.v1.CertificateConfig.Builder,
                com.google.cloud.security.privateca.v1.CertificateConfigOrBuilder>(
                (com.google.cloud.security.privateca.v1.CertificateConfig) certificateConfig_,
                getParentForChildren(),
                isClean());
        certificateConfig_ = null;
      }
      certificateConfigCase_ = 3;
      onChanged();
      return configBuilder_;
    }

    private java.lang.Object issuerCertificateAuthority_ = "";
    /**
     *
     *
     * <pre>
     * Output only. The resource name of the issuing
     * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
     * in the format `projects/&#42;&#47;locations/&#42;&#47;caPools/&#42;&#47;certificateAuthorities/&#42;`.
     * </pre>
     *
     * <code>
     * string issuer_certificate_authority = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The issuerCertificateAuthority.
     */
    public java.lang.String getIssuerCertificateAuthority() {
      java.lang.Object ref = issuerCertificateAuthority_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        issuerCertificateAuthority_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The resource name of the issuing
     * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
     * in the format `projects/&#42;&#47;locations/&#42;&#47;caPools/&#42;&#47;certificateAuthorities/&#42;`.
     * </pre>
     *
     * <code>
     * string issuer_certificate_authority = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for issuerCertificateAuthority.
     */
    public com.google.protobuf.ByteString getIssuerCertificateAuthorityBytes() {
      java.lang.Object ref = issuerCertificateAuthority_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        issuerCertificateAuthority_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The resource name of the issuing
     * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
     * in the format `projects/&#42;&#47;locations/&#42;&#47;caPools/&#42;&#47;certificateAuthorities/&#42;`.
     * </pre>
     *
     * <code>
     * string issuer_certificate_authority = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The issuerCertificateAuthority to set.
     * @return This builder for chaining.
     */
    public Builder setIssuerCertificateAuthority(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      issuerCertificateAuthority_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The resource name of the issuing
     * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
     * in the format `projects/&#42;&#47;locations/&#42;&#47;caPools/&#42;&#47;certificateAuthorities/&#42;`.
     * </pre>
     *
     * <code>
     * string issuer_certificate_authority = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearIssuerCertificateAuthority() {
      issuerCertificateAuthority_ = getDefaultInstance().getIssuerCertificateAuthority();
      bitField0_ = (bitField0_ & ~0x00000008);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The resource name of the issuing
     * [CertificateAuthority][google.cloud.security.privateca.v1.CertificateAuthority]
     * in the format `projects/&#42;&#47;locations/&#42;&#47;caPools/&#42;&#47;certificateAuthorities/&#42;`.
     * </pre>
     *
     * <code>
     * string issuer_certificate_authority = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for issuerCertificateAuthority to set.
     * @return This builder for chaining.
     */
    public Builder setIssuerCertificateAuthorityBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      issuerCertificateAuthority_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

    private com.google.protobuf.Duration lifetime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Duration,
            com.google.protobuf.Duration.Builder,
            com.google.protobuf.DurationOrBuilder>
        lifetimeBuilder_;
    /**
     *
     *
     * <pre>
     * Required. Immutable. The desired lifetime of a certificate. Used to create
     * the "not_before_time" and "not_after_time" fields inside an X.509
     * certificate. Note that the lifetime may be truncated if it would extend
     * past the life of any certificate authority in the issuing chain.
     * </pre>
     *
     * <code>
     * .google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
     * </code>
     *
     * @return Whether the lifetime field is set.
     */
    public boolean hasLifetime() {
      return ((bitField0_ & 0x00000010) != 0);
    }
    /**
     *
     *
     * <pre>
     * Required. Immutable. The desired lifetime of a certificate. Used to create
     * the "not_before_time" and "not_after_time" fields inside an X.509
     * certificate. Note that the lifetime may be truncated if it would extend
     * past the life of any certificate authority in the issuing chain.
     * </pre>
     *
     * <code>
     * .google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
     * </code>
     *
     * @return The lifetime.
     */
    public com.google.protobuf.Duration getLifetime() {
      if (lifetimeBuilder_ == null) {
        return lifetime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : lifetime_;
      } else {
        return lifetimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Immutable. The desired lifetime of a certificate. Used to create
     * the "not_before_time" and "not_after_time" fields inside an X.509
     * certificate. Note that the lifetime may be truncated if it would extend
     * past the life of any certificate authority in the issuing chain.
     * </pre>
     *
     * <code>
     * .google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder setLifetime(com.google.protobuf.Duration value) {
      if (lifetimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        lifetime_ = value;
      } else {
        lifetimeBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Immutable. The desired lifetime of a certificate. Used to create
     * the "not_before_time" and "not_after_time" fields inside an X.509
     * certificate. Note that the lifetime may be truncated if it would extend
     * past the life of any certificate authority in the issuing chain.
     * </pre>
     *
     * <code>
     * .google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder setLifetime(com.google.protobuf.Duration.Builder builderForValue) {
      if (lifetimeBuilder_ == null) {
        lifetime_ = builderForValue.build();
      } else {
        lifetimeBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Immutable. The desired lifetime of a certificate. Used to create
     * the "not_before_time" and "not_after_time" fields inside an X.509
     * certificate. Note that the lifetime may be truncated if it would extend
     * past the life of any certificate authority in the issuing chain.
     * </pre>
     *
     * <code>
     * .google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder mergeLifetime(com.google.protobuf.Duration value) {
      if (lifetimeBuilder_ == null) {
        if (((bitField0_ & 0x00000010) != 0)
            && lifetime_ != null
            && lifetime_ != com.google.protobuf.Duration.getDefaultInstance()) {
          getLifetimeBuilder().mergeFrom(value);
        } else {
          lifetime_ = value;
        }
      } else {
        lifetimeBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Immutable. The desired lifetime of a certificate. Used to create
     * the "not_before_time" and "not_after_time" fields inside an X.509
     * certificate. Note that the lifetime may be truncated if it would extend
     * past the life of any certificate authority in the issuing chain.
     * </pre>
     *
     * <code>
     * .google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder clearLifetime() {
      bitField0_ = (bitField0_ & ~0x00000010);
      lifetime_ = null;
      if (lifetimeBuilder_ != null) {
        lifetimeBuilder_.dispose();
        lifetimeBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required. Immutable. The desired lifetime of a certificate. Used to create
     * the "not_before_time" and "not_after_time" fields inside an X.509
     * certificate. Note that the lifetime may be truncated if it would extend
     * past the life of any certificate authority in the issuing chain.
     * </pre>
     *
     * <code>
     * .google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public com.google.protobuf.Duration.Builder getLifetimeBuilder() {
      bitField0_ |= 0x00000010;
      onChanged();
      return getLifetimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required. Immutable. The desired lifetime of a certificate. Used to create
     * the "not_before_time" and "not_after_time" fields inside an X.509
     * certificate. Note that the lifetime may be truncated if it would extend
     * past the life of any certificate authority in the issuing chain.
     * </pre>
     *
     * <code>
     * .google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public com.google.protobuf.DurationOrBuilder getLifetimeOrBuilder() {
      if (lifetimeBuilder_ != null) {
        return lifetimeBuilder_.getMessageOrBuilder();
      } else {
        return lifetime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : lifetime_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required. Immutable. The desired lifetime of a certificate. Used to create
     * the "not_before_time" and "not_after_time" fields inside an X.509
     * certificate. Note that the lifetime may be truncated if it would extend
     * past the life of any certificate authority in the issuing chain.
     * </pre>
     *
     * <code>
     * .google.protobuf.Duration lifetime = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Duration,
            com.google.protobuf.Duration.Builder,
            com.google.protobuf.DurationOrBuilder>
        getLifetimeFieldBuilder() {
      if (lifetimeBuilder_ == null) {
        lifetimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Duration,
                com.google.protobuf.Duration.Builder,
                com.google.protobuf.DurationOrBuilder>(
                getLifetime(), getParentForChildren(), isClean());
        lifetime_ = null;
      }
      return lifetimeBuilder_;
    }

    private java.lang.Object certificateTemplate_ = "";
    /**
     *
     *
     * <pre>
     * Immutable. The resource name for a
     * [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
     * used to issue this certificate, in the format
     * `projects/&#42;&#47;locations/&#42;&#47;certificateTemplates/&#42;`.
     * If this is specified, the caller must have the necessary permission to
     * use this template. If this is omitted, no template will be used.
     * This template must be in the same location as the
     * [Certificate][google.cloud.security.privateca.v1.Certificate].
     * </pre>
     *
     * <code>
     * string certificate_template = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The certificateTemplate.
     */
    public java.lang.String getCertificateTemplate() {
      java.lang.Object ref = certificateTemplate_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        certificateTemplate_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. The resource name for a
     * [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
     * used to issue this certificate, in the format
     * `projects/&#42;&#47;locations/&#42;&#47;certificateTemplates/&#42;`.
     * If this is specified, the caller must have the necessary permission to
     * use this template. If this is omitted, no template will be used.
     * This template must be in the same location as the
     * [Certificate][google.cloud.security.privateca.v1.Certificate].
     * </pre>
     *
     * <code>
     * string certificate_template = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for certificateTemplate.
     */
    public com.google.protobuf.ByteString getCertificateTemplateBytes() {
      java.lang.Object ref = certificateTemplate_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        certificateTemplate_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. The resource name for a
     * [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
     * used to issue this certificate, in the format
     * `projects/&#42;&#47;locations/&#42;&#47;certificateTemplates/&#42;`.
     * If this is specified, the caller must have the necessary permission to
     * use this template. If this is omitted, no template will be used.
     * This template must be in the same location as the
     * [Certificate][google.cloud.security.privateca.v1.Certificate].
     * </pre>
     *
     * <code>
     * string certificate_template = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The certificateTemplate to set.
     * @return This builder for chaining.
     */
    public Builder setCertificateTemplate(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      certificateTemplate_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. The resource name for a
     * [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
     * used to issue this certificate, in the format
     * `projects/&#42;&#47;locations/&#42;&#47;certificateTemplates/&#42;`.
     * If this is specified, the caller must have the necessary permission to
     * use this template. If this is omitted, no template will be used.
     * This template must be in the same location as the
     * [Certificate][google.cloud.security.privateca.v1.Certificate].
     * </pre>
     *
     * <code>
     * string certificate_template = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearCertificateTemplate() {
      certificateTemplate_ = getDefaultInstance().getCertificateTemplate();
      bitField0_ = (bitField0_ & ~0x00000020);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. The resource name for a
     * [CertificateTemplate][google.cloud.security.privateca.v1.CertificateTemplate]
     * used to issue this certificate, in the format
     * `projects/&#42;&#47;locations/&#42;&#47;certificateTemplates/&#42;`.
     * If this is specified, the caller must have the necessary permission to
     * use this template. If this is omitted, no template will be used.
     * This template must be in the same location as the
     * [Certificate][google.cloud.security.privateca.v1.Certificate].
     * </pre>
     *
     * <code>
     * string certificate_template = 6 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for certificateTemplate to set.
     * @return This builder for chaining.
     */
    public Builder setCertificateTemplateBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      certificateTemplate_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }

    private int subjectMode_ = 0;
    /**
     *
     *
     * <pre>
     * Immutable. Specifies how the
     * [Certificate][google.cloud.security.privateca.v1.Certificate]'s identity
     * fields are to be decided. If this is omitted, the `DEFAULT` subject mode
     * will be used.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.SubjectRequestMode subject_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     *
     * @return The enum numeric value on the wire for subjectMode.
     */
    @java.lang.Override
    public int getSubjectModeValue() {
      return subjectMode_;
    }
    /**
     *
     *
     * <pre>
     * Immutable. Specifies how the
     * [Certificate][google.cloud.security.privateca.v1.Certificate]'s identity
     * fields are to be decided. If this is omitted, the `DEFAULT` subject mode
     * will be used.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.SubjectRequestMode subject_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     *
     * @param value The enum numeric value on the wire for subjectMode to set.
     * @return This builder for chaining.
     */
    public Builder setSubjectModeValue(int value) {
      subjectMode_ = value;
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. Specifies how the
     * [Certificate][google.cloud.security.privateca.v1.Certificate]'s identity
     * fields are to be decided. If this is omitted, the `DEFAULT` subject mode
     * will be used.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.SubjectRequestMode subject_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     *
     * @return The subjectMode.
     */
    @java.lang.Override
    public com.google.cloud.security.privateca.v1.SubjectRequestMode getSubjectMode() {
      com.google.cloud.security.privateca.v1.SubjectRequestMode result =
          com.google.cloud.security.privateca.v1.SubjectRequestMode.forNumber(subjectMode_);
      return result == null
          ? com.google.cloud.security.privateca.v1.SubjectRequestMode.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * Immutable. Specifies how the
     * [Certificate][google.cloud.security.privateca.v1.Certificate]'s identity
     * fields are to be decided. If this is omitted, the `DEFAULT` subject mode
     * will be used.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.SubjectRequestMode subject_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     *
     * @param value The subjectMode to set.
     * @return This builder for chaining.
     */
    public Builder setSubjectMode(com.google.cloud.security.privateca.v1.SubjectRequestMode value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000040;
      subjectMode_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. Specifies how the
     * [Certificate][google.cloud.security.privateca.v1.Certificate]'s identity
     * fields are to be decided. If this is omitted, the `DEFAULT` subject mode
     * will be used.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.SubjectRequestMode subject_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearSubjectMode() {
      bitField0_ = (bitField0_ & ~0x00000040);
      subjectMode_ = 0;
      onChanged();
      return this;
    }

    private com.google.cloud.security.privateca.v1.Certificate.RevocationDetails revocationDetails_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.security.privateca.v1.Certificate.RevocationDetails,
            com.google.cloud.security.privateca.v1.Certificate.RevocationDetails.Builder,
            com.google.cloud.security.privateca.v1.Certificate.RevocationDetailsOrBuilder>
        revocationDetailsBuilder_;
    /**
     *
     *
     * <pre>
     * Output only. Details regarding the revocation of this
     * [Certificate][google.cloud.security.privateca.v1.Certificate]. This
     * [Certificate][google.cloud.security.privateca.v1.Certificate] is considered
     * revoked if and only if this field is present.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.Certificate.RevocationDetails revocation_details = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return Whether the revocationDetails field is set.
     */
    public boolean hasRevocationDetails() {
      return ((bitField0_ & 0x00000080) != 0);
    }
    /**
     *
     *
     * <pre>
     * Output only. Details regarding the revocation of this
     * [Certificate][google.cloud.security.privateca.v1.Certificate]. This
     * [Certificate][google.cloud.security.privateca.v1.Certificate] is considered
     * revoked if and only if this field is present.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.Certificate.RevocationDetails revocation_details = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The revocationDetails.
     */
    public com.google.cloud.security.privateca.v1.Certificate.RevocationDetails
        getRevocationDetails() {
      if (revocationDetailsBuilder_ == null) {
        return revocationDetails_ == null
            ? com.google.cloud.security.privateca.v1.Certificate.RevocationDetails
                .getDefaultInstance()
            : revocationDetails_;
      } else {
        return revocationDetailsBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Details regarding the revocation of this
     * [Certificate][google.cloud.security.privateca.v1.Certificate]. This
     * [Certificate][google.cloud.security.privateca.v1.Certificate] is considered
     * revoked if and only if this field is present.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.Certificate.RevocationDetails revocation_details = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setRevocationDetails(
        com.google.cloud.security.privateca.v1.Certificate.RevocationDetails value) {
      if (revocationDetailsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        revocationDetails_ = value;
      } else {
        revocationDetailsBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000080;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Details regarding the revocation of this
     * [Certificate][google.cloud.security.privateca.v1.Certificate]. This
     * [Certificate][google.cloud.security.privateca.v1.Certificate] is considered
     * revoked if and only if this field is present.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.Certificate.RevocationDetails revocation_details = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setRevocationDetails(
        com.google.cloud.security.privateca.v1.Certificate.RevocationDetails.Builder
            builderForValue) {
      if (revocationDetailsBuilder_ == null) {
        revocationDetails_ = builderForValue.build();
      } else {
        revocationDetailsBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000080;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Details regarding the revocation of this
     * [Certificate][google.cloud.security.privateca.v1.Certificate]. This
     * [Certificate][google.cloud.security.privateca.v1.Certificate] is considered
     * revoked if and only if this field is present.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.Certificate.RevocationDetails revocation_details = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder mergeRevocationDetails(
        com.google.cloud.security.privateca.v1.Certificate.RevocationDetails value) {
      if (revocationDetailsBuilder_ == null) {
        if (((bitField0_ & 0x00000080) != 0)
            && revocationDetails_ != null
            && revocationDetails_
                != com.google.cloud.security.privateca.v1.Certificate.RevocationDetails
                    .getDefaultInstance()) {
          getRevocationDetailsBuilder().mergeFrom(value);
        } else {
          revocationDetails_ = value;
        }
      } else {
        revocationDetailsBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000080;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Details regarding the revocation of this
     * [Certificate][google.cloud.security.privateca.v1.Certificate]. This
     * [Certificate][google.cloud.security.privateca.v1.Certificate] is considered
     * revoked if and only if this field is present.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.Certificate.RevocationDetails revocation_details = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder clearRevocationDetails() {
      bitField0_ = (bitField0_ & ~0x00000080);
      revocationDetails_ = null;
      if (revocationDetailsBuilder_ != null) {
        revocationDetailsBuilder_.dispose();
        revocationDetailsBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Details regarding the revocation of this
     * [Certificate][google.cloud.security.privateca.v1.Certificate]. This
     * [Certificate][google.cloud.security.privateca.v1.Certificate] is considered
     * revoked if and only if this field is present.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.Certificate.RevocationDetails revocation_details = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.cloud.security.privateca.v1.Certificate.RevocationDetails.Builder
        getRevocationDetailsBuilder() {
      bitField0_ |= 0x00000080;
      onChanged();
      return getRevocationDetailsFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Output only. Details regarding the revocation of this
     * [Certificate][google.cloud.security.privateca.v1.Certificate]. This
     * [Certificate][google.cloud.security.privateca.v1.Certificate] is considered
     * revoked if and only if this field is present.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.Certificate.RevocationDetails revocation_details = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.cloud.security.privateca.v1.Certificate.RevocationDetailsOrBuilder
        getRevocationDetailsOrBuilder() {
      if (revocationDetailsBuilder_ != null) {
        return revocationDetailsBuilder_.getMessageOrBuilder();
      } else {
        return revocationDetails_ == null
            ? com.google.cloud.security.privateca.v1.Certificate.RevocationDetails
                .getDefaultInstance()
            : revocationDetails_;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Details regarding the revocation of this
     * [Certificate][google.cloud.security.privateca.v1.Certificate]. This
     * [Certificate][google.cloud.security.privateca.v1.Certificate] is considered
     * revoked if and only if this field is present.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.Certificate.RevocationDetails revocation_details = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.security.privateca.v1.Certificate.RevocationDetails,
            com.google.cloud.security.privateca.v1.Certificate.RevocationDetails.Builder,
            com.google.cloud.security.privateca.v1.Certificate.RevocationDetailsOrBuilder>
        getRevocationDetailsFieldBuilder() {
      if (revocationDetailsBuilder_ == null) {
        revocationDetailsBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.security.privateca.v1.Certificate.RevocationDetails,
                com.google.cloud.security.privateca.v1.Certificate.RevocationDetails.Builder,
                com.google.cloud.security.privateca.v1.Certificate.RevocationDetailsOrBuilder>(
                getRevocationDetails(), getParentForChildren(), isClean());
        revocationDetails_ = null;
      }
      return revocationDetailsBuilder_;
    }

    private java.lang.Object pemCertificate_ = "";
    /**
     *
     *
     * <pre>
     * Output only. The pem-encoded, signed X.509 certificate.
     * </pre>
     *
     * <code>string pem_certificate = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The pemCertificate.
     */
    public java.lang.String getPemCertificate() {
      java.lang.Object ref = pemCertificate_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        pemCertificate_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The pem-encoded, signed X.509 certificate.
     * </pre>
     *
     * <code>string pem_certificate = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The bytes for pemCertificate.
     */
    public com.google.protobuf.ByteString getPemCertificateBytes() {
      java.lang.Object ref = pemCertificate_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        pemCertificate_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The pem-encoded, signed X.509 certificate.
     * </pre>
     *
     * <code>string pem_certificate = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The pemCertificate to set.
     * @return This builder for chaining.
     */
    public Builder setPemCertificate(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      pemCertificate_ = value;
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The pem-encoded, signed X.509 certificate.
     * </pre>
     *
     * <code>string pem_certificate = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPemCertificate() {
      pemCertificate_ = getDefaultInstance().getPemCertificate();
      bitField0_ = (bitField0_ & ~0x00000100);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The pem-encoded, signed X.509 certificate.
     * </pre>
     *
     * <code>string pem_certificate = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The bytes for pemCertificate to set.
     * @return This builder for chaining.
     */
    public Builder setPemCertificateBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      pemCertificate_ = value;
      bitField0_ |= 0x00000100;
      onChanged();
      return this;
    }

    private com.google.cloud.security.privateca.v1.CertificateDescription certificateDescription_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.security.privateca.v1.CertificateDescription,
            com.google.cloud.security.privateca.v1.CertificateDescription.Builder,
            com.google.cloud.security.privateca.v1.CertificateDescriptionOrBuilder>
        certificateDescriptionBuilder_;
    /**
     *
     *
     * <pre>
     * Output only. A structured description of the issued X.509 certificate.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateDescription certificate_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return Whether the certificateDescription field is set.
     */
    public boolean hasCertificateDescription() {
      return ((bitField0_ & 0x00000200) != 0);
    }
    /**
     *
     *
     * <pre>
     * Output only. A structured description of the issued X.509 certificate.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateDescription certificate_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The certificateDescription.
     */
    public com.google.cloud.security.privateca.v1.CertificateDescription
        getCertificateDescription() {
      if (certificateDescriptionBuilder_ == null) {
        return certificateDescription_ == null
            ? com.google.cloud.security.privateca.v1.CertificateDescription.getDefaultInstance()
            : certificateDescription_;
      } else {
        return certificateDescriptionBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. A structured description of the issued X.509 certificate.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateDescription certificate_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setCertificateDescription(
        com.google.cloud.security.privateca.v1.CertificateDescription value) {
      if (certificateDescriptionBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        certificateDescription_ = value;
      } else {
        certificateDescriptionBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000200;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. A structured description of the issued X.509 certificate.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateDescription certificate_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setCertificateDescription(
        com.google.cloud.security.privateca.v1.CertificateDescription.Builder builderForValue) {
      if (certificateDescriptionBuilder_ == null) {
        certificateDescription_ = builderForValue.build();
      } else {
        certificateDescriptionBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000200;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. A structured description of the issued X.509 certificate.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateDescription certificate_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder mergeCertificateDescription(
        com.google.cloud.security.privateca.v1.CertificateDescription value) {
      if (certificateDescriptionBuilder_ == null) {
        if (((bitField0_ & 0x00000200) != 0)
            && certificateDescription_ != null
            && certificateDescription_
                != com.google.cloud.security.privateca.v1.CertificateDescription
                    .getDefaultInstance()) {
          getCertificateDescriptionBuilder().mergeFrom(value);
        } else {
          certificateDescription_ = value;
        }
      } else {
        certificateDescriptionBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000200;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. A structured description of the issued X.509 certificate.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateDescription certificate_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder clearCertificateDescription() {
      bitField0_ = (bitField0_ & ~0x00000200);
      certificateDescription_ = null;
      if (certificateDescriptionBuilder_ != null) {
        certificateDescriptionBuilder_.dispose();
        certificateDescriptionBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. A structured description of the issued X.509 certificate.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateDescription certificate_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.cloud.security.privateca.v1.CertificateDescription.Builder
        getCertificateDescriptionBuilder() {
      bitField0_ |= 0x00000200;
      onChanged();
      return getCertificateDescriptionFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Output only. A structured description of the issued X.509 certificate.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateDescription certificate_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.cloud.security.privateca.v1.CertificateDescriptionOrBuilder
        getCertificateDescriptionOrBuilder() {
      if (certificateDescriptionBuilder_ != null) {
        return certificateDescriptionBuilder_.getMessageOrBuilder();
      } else {
        return certificateDescription_ == null
            ? com.google.cloud.security.privateca.v1.CertificateDescription.getDefaultInstance()
            : certificateDescription_;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. A structured description of the issued X.509 certificate.
     * </pre>
     *
     * <code>
     * .google.cloud.security.privateca.v1.CertificateDescription certificate_description = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.security.privateca.v1.CertificateDescription,
            com.google.cloud.security.privateca.v1.CertificateDescription.Builder,
            com.google.cloud.security.privateca.v1.CertificateDescriptionOrBuilder>
        getCertificateDescriptionFieldBuilder() {
      if (certificateDescriptionBuilder_ == null) {
        certificateDescriptionBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.security.privateca.v1.CertificateDescription,
                com.google.cloud.security.privateca.v1.CertificateDescription.Builder,
                com.google.cloud.security.privateca.v1.CertificateDescriptionOrBuilder>(
                getCertificateDescription(), getParentForChildren(), isClean());
        certificateDescription_ = null;
      }
      return certificateDescriptionBuilder_;
    }

    private com.google.protobuf.LazyStringList pemCertificateChain_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensurePemCertificateChainIsMutable() {
      if (!((bitField0_ & 0x00000400) != 0)) {
        pemCertificateChain_ = new com.google.protobuf.LazyStringArrayList(pemCertificateChain_);
        bitField0_ |= 0x00000400;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The chain that may be used to verify the X.509 certificate.
     * Expected to be in issuer-to-root order according to RFC 5246.
     * </pre>
     *
     * <code>
     * repeated string pem_certificate_chain = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return A list containing the pemCertificateChain.
     */
    public com.google.protobuf.ProtocolStringList getPemCertificateChainList() {
      return pemCertificateChain_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * Output only. The chain that may be used to verify the X.509 certificate.
     * Expected to be in issuer-to-root order according to RFC 5246.
     * </pre>
     *
     * <code>
     * repeated string pem_certificate_chain = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The count of pemCertificateChain.
     */
    public int getPemCertificateChainCount() {
      return pemCertificateChain_.size();
    }
    /**
     *
     *
     * <pre>
     * Output only. The chain that may be used to verify the X.509 certificate.
     * Expected to be in issuer-to-root order according to RFC 5246.
     * </pre>
     *
     * <code>
     * repeated string pem_certificate_chain = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param index The index of the element to return.
     * @return The pemCertificateChain at the given index.
     */
    public java.lang.String getPemCertificateChain(int index) {
      return pemCertificateChain_.get(index);
    }
    /**
     *
     *
     * <pre>
     * Output only. The chain that may be used to verify the X.509 certificate.
     * Expected to be in issuer-to-root order according to RFC 5246.
     * </pre>
     *
     * <code>
     * repeated string pem_certificate_chain = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the pemCertificateChain at the given index.
     */
    public com.google.protobuf.ByteString getPemCertificateChainBytes(int index) {
      return pemCertificateChain_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * Output only. The chain that may be used to verify the X.509 certificate.
     * Expected to be in issuer-to-root order according to RFC 5246.
     * </pre>
     *
     * <code>
     * repeated string pem_certificate_chain = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param index The index to set the value at.
     * @param value The pemCertificateChain to set.
     * @return This builder for chaining.
     */
    public Builder setPemCertificateChain(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensurePemCertificateChainIsMutable();
      pemCertificateChain_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The chain that may be used to verify the X.509 certificate.
     * Expected to be in issuer-to-root order according to RFC 5246.
     * </pre>
     *
     * <code>
     * repeated string pem_certificate_chain = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param value The pemCertificateChain to add.
     * @return This builder for chaining.
     */
    public Builder addPemCertificateChain(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensurePemCertificateChainIsMutable();
      pemCertificateChain_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The chain that may be used to verify the X.509 certificate.
     * Expected to be in issuer-to-root order according to RFC 5246.
     * </pre>
     *
     * <code>
     * repeated string pem_certificate_chain = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param values The pemCertificateChain to add.
     * @return This builder for chaining.
     */
    public Builder addAllPemCertificateChain(java.lang.Iterable<java.lang.String> values) {
      ensurePemCertificateChainIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pemCertificateChain_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The chain that may be used to verify the X.509 certificate.
     * Expected to be in issuer-to-root order according to RFC 5246.
     * </pre>
     *
     * <code>
     * repeated string pem_certificate_chain = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPemCertificateChain() {
      pemCertificateChain_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000400);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The chain that may be used to verify the X.509 certificate.
     * Expected to be in issuer-to-root order according to RFC 5246.
     * </pre>
     *
     * <code>
     * repeated string pem_certificate_chain = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param value The bytes of the pemCertificateChain to add.
     * @return This builder for chaining.
     */
    public Builder addPemCertificateChainBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensurePemCertificateChainIsMutable();
      pemCertificateChain_.add(value);
      onChanged();
      return this;
    }

    private com.google.protobuf.Timestamp createTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        createTimeBuilder_;
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return Whether the createTime field is set.
     */
    public boolean hasCreateTime() {
      return ((bitField0_ & 0x00000800) != 0);
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The createTime.
     */
    public com.google.protobuf.Timestamp getCreateTime() {
      if (createTimeBuilder_ == null) {
        return createTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : createTime_;
      } else {
        return createTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setCreateTime(com.google.protobuf.Timestamp value) {
      if (createTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        createTime_ = value;
      } else {
        createTimeBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000800;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (createTimeBuilder_ == null) {
        createTime_ = builderForValue.build();
      } else {
        createTimeBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000800;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder mergeCreateTime(com.google.protobuf.Timestamp value) {
      if (createTimeBuilder_ == null) {
        if (((bitField0_ & 0x00000800) != 0)
            && createTime_ != null
            && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          getCreateTimeBuilder().mergeFrom(value);
        } else {
          createTime_ = value;
        }
      } else {
        createTimeBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000800;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder clearCreateTime() {
      bitField0_ = (bitField0_ & ~0x00000800);
      createTime_ = null;
      if (createTimeBuilder_ != null) {
        createTimeBuilder_.dispose();
        createTimeBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() {
      bitField0_ |= 0x00000800;
      onChanged();
      return getCreateTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
      if (createTimeBuilder_ != null) {
        return createTimeBuilder_.getMessageOrBuilder();
      } else {
        return createTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : createTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was created.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getCreateTimeFieldBuilder() {
      if (createTimeBuilder_ == null) {
        createTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getCreateTime(), getParentForChildren(), isClean());
        createTime_ = null;
      }
      return createTimeBuilder_;
    }

    private com.google.protobuf.Timestamp updateTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        updateTimeBuilder_;
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return Whether the updateTime field is set.
     */
    public boolean hasUpdateTime() {
      return ((bitField0_ & 0x00001000) != 0);
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The updateTime.
     */
    public com.google.protobuf.Timestamp getUpdateTime() {
      if (updateTimeBuilder_ == null) {
        return updateTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : updateTime_;
      } else {
        return updateTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setUpdateTime(com.google.protobuf.Timestamp value) {
      if (updateTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        updateTime_ = value;
      } else {
        updateTimeBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00001000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (updateTimeBuilder_ == null) {
        updateTime_ = builderForValue.build();
      } else {
        updateTimeBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00001000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) {
      if (updateTimeBuilder_ == null) {
        if (((bitField0_ & 0x00001000) != 0)
            && updateTime_ != null
            && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          getUpdateTimeBuilder().mergeFrom(value);
        } else {
          updateTime_ = value;
        }
      } else {
        updateTimeBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00001000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder clearUpdateTime() {
      bitField0_ = (bitField0_ & ~0x00001000);
      updateTime_ = null;
      if (updateTimeBuilder_ != null) {
        updateTimeBuilder_.dispose();
        updateTimeBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() {
      bitField0_ |= 0x00001000;
      onChanged();
      return getUpdateTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
      if (updateTimeBuilder_ != null) {
        return updateTimeBuilder_.getMessageOrBuilder();
      } else {
        return updateTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : updateTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The time at which this
     * [Certificate][google.cloud.security.privateca.v1.Certificate] was updated.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getUpdateTimeFieldBuilder() {
      if (updateTimeBuilder_ == null) {
        updateTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getUpdateTime(), getParentForChildren(), isClean());
        updateTime_ = null;
      }
      return updateTimeBuilder_;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_;

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
      if (labels_ == null) {
        return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
      }
      return labels_;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetMutableLabels() {
      if (labels_ == null) {
        labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry);
      }
      if (!labels_.isMutable()) {
        labels_ = labels_.copy();
      }
      bitField0_ |= 0x00002000;
      onChanged();
      return labels_;
    }

    public int getLabelsCount() {
      return internalGetLabels().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * Optional. Labels with user-defined metadata.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    @java.lang.Override
    public boolean containsLabels(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      return internalGetLabels().getMap().containsKey(key);
    }
    /** Use {@link #getLabelsMap()} instead. */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getLabels() {
      return getLabelsMap();
    }
    /**
     *
     *
     * <pre>
     * Optional. Labels with user-defined metadata.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    @java.lang.Override
    public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
      return internalGetLabels().getMap();
    }
    /**
     *
     *
     * <pre>
     * Optional. Labels with user-defined metadata.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    @java.lang.Override
    public /* nullable */ java.lang.String getLabelsOrDefault(
        java.lang.String key,
        /* nullable */
        java.lang.String defaultValue) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * Optional. Labels with user-defined metadata.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    @java.lang.Override
    public java.lang.String getLabelsOrThrow(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearLabels() {
      bitField0_ = (bitField0_ & ~0x00002000);
      internalGetMutableLabels().getMutableMap().clear();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Labels with user-defined metadata.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder removeLabels(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      internalGetMutableLabels().getMutableMap().remove(key);
      return this;
    }
    /** Use alternate mutation accessors instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getMutableLabels() {
      bitField0_ |= 0x00002000;
      return internalGetMutableLabels().getMutableMap();
    }
    /**
     *
     *
     * <pre>
     * Optional. Labels with user-defined metadata.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder putLabels(java.lang.String key, java.lang.String value) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      if (value == null) {
        throw new NullPointerException("map value");
      }
      internalGetMutableLabels().getMutableMap().put(key, value);
      bitField0_ |= 0x00002000;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. Labels with user-defined metadata.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 14 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder putAllLabels(java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableLabels().getMutableMap().putAll(values);
      bitField0_ |= 0x00002000;
      return this;
    }

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

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

    // @@protoc_insertion_point(builder_scope:google.cloud.security.privateca.v1.Certificate)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.security.privateca.v1.Certificate)
  private static final com.google.cloud.security.privateca.v1.Certificate DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.security.privateca.v1.Certificate();
  }

  public static com.google.cloud.security.privateca.v1.Certificate getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<Certificate> PARSER =
      new com.google.protobuf.AbstractParser<Certificate>() {
        @java.lang.Override
        public Certificate 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<Certificate> parser() {
    return PARSER;
  }

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

  @java.lang.Override
  public com.google.cloud.security.privateca.v1.Certificate getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
