/*
 * Copyright 2023 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/devtools/cloudbuild/v1/cloudbuild.proto

package com.google.cloudbuild.v1;

/**
 *
 *
 * <pre>
 * GitHubEnterpriseSecrets represents the names of all necessary secrets in
 * Secret Manager for a GitHub Enterprise server.
 * Format is: projects/&lt;project number&gt;/secrets/&lt;secret name&gt;.
 * </pre>
 *
 * Protobuf type {@code google.devtools.cloudbuild.v1.GitHubEnterpriseSecrets}
 */
public final class GitHubEnterpriseSecrets extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.devtools.cloudbuild.v1.GitHubEnterpriseSecrets)
    GitHubEnterpriseSecretsOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use GitHubEnterpriseSecrets.newBuilder() to construct.
  private GitHubEnterpriseSecrets(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private GitHubEnterpriseSecrets() {
    privateKeyVersionName_ = "";
    webhookSecretVersionName_ = "";
    oauthSecretVersionName_ = "";
    oauthClientIdVersionName_ = "";
  }

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

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloudbuild.v1.Cloudbuild
        .internal_static_google_devtools_cloudbuild_v1_GitHubEnterpriseSecrets_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloudbuild.v1.Cloudbuild
        .internal_static_google_devtools_cloudbuild_v1_GitHubEnterpriseSecrets_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloudbuild.v1.GitHubEnterpriseSecrets.class,
            com.google.cloudbuild.v1.GitHubEnterpriseSecrets.Builder.class);
  }

  public static final int PRIVATE_KEY_VERSION_NAME_FIELD_NUMBER = 5;

  @SuppressWarnings("serial")
  private volatile java.lang.Object privateKeyVersionName_ = "";
  /**
   *
   *
   * <pre>
   * The resource name for the private key secret version.
   * </pre>
   *
   * <code>string private_key_version_name = 5 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The privateKeyVersionName.
   */
  @java.lang.Override
  public java.lang.String getPrivateKeyVersionName() {
    java.lang.Object ref = privateKeyVersionName_;
    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();
      privateKeyVersionName_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The resource name for the private key secret version.
   * </pre>
   *
   * <code>string private_key_version_name = 5 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The bytes for privateKeyVersionName.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getPrivateKeyVersionNameBytes() {
    java.lang.Object ref = privateKeyVersionName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      privateKeyVersionName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int WEBHOOK_SECRET_VERSION_NAME_FIELD_NUMBER = 6;

  @SuppressWarnings("serial")
  private volatile java.lang.Object webhookSecretVersionName_ = "";
  /**
   *
   *
   * <pre>
   * The resource name for the webhook secret secret version in Secret Manager.
   * </pre>
   *
   * <code>string webhook_secret_version_name = 6 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The webhookSecretVersionName.
   */
  @java.lang.Override
  public java.lang.String getWebhookSecretVersionName() {
    java.lang.Object ref = webhookSecretVersionName_;
    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();
      webhookSecretVersionName_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The resource name for the webhook secret secret version in Secret Manager.
   * </pre>
   *
   * <code>string webhook_secret_version_name = 6 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The bytes for webhookSecretVersionName.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getWebhookSecretVersionNameBytes() {
    java.lang.Object ref = webhookSecretVersionName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      webhookSecretVersionName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int OAUTH_SECRET_VERSION_NAME_FIELD_NUMBER = 7;

  @SuppressWarnings("serial")
  private volatile java.lang.Object oauthSecretVersionName_ = "";
  /**
   *
   *
   * <pre>
   * The resource name for the OAuth secret secret version in Secret Manager.
   * </pre>
   *
   * <code>string oauth_secret_version_name = 7 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The oauthSecretVersionName.
   */
  @java.lang.Override
  public java.lang.String getOauthSecretVersionName() {
    java.lang.Object ref = oauthSecretVersionName_;
    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();
      oauthSecretVersionName_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The resource name for the OAuth secret secret version in Secret Manager.
   * </pre>
   *
   * <code>string oauth_secret_version_name = 7 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The bytes for oauthSecretVersionName.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getOauthSecretVersionNameBytes() {
    java.lang.Object ref = oauthSecretVersionName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      oauthSecretVersionName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int OAUTH_CLIENT_ID_VERSION_NAME_FIELD_NUMBER = 8;

  @SuppressWarnings("serial")
  private volatile java.lang.Object oauthClientIdVersionName_ = "";
  /**
   *
   *
   * <pre>
   * The resource name for the OAuth client ID secret version in Secret Manager.
   * </pre>
   *
   * <code>string oauth_client_id_version_name = 8 [(.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The oauthClientIdVersionName.
   */
  @java.lang.Override
  public java.lang.String getOauthClientIdVersionName() {
    java.lang.Object ref = oauthClientIdVersionName_;
    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();
      oauthClientIdVersionName_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The resource name for the OAuth client ID secret version in Secret Manager.
   * </pre>
   *
   * <code>string oauth_client_id_version_name = 8 [(.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for oauthClientIdVersionName.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getOauthClientIdVersionNameBytes() {
    java.lang.Object ref = oauthClientIdVersionName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      oauthClientIdVersionName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  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(privateKeyVersionName_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, privateKeyVersionName_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(webhookSecretVersionName_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, webhookSecretVersionName_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(oauthSecretVersionName_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 7, oauthSecretVersionName_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(oauthClientIdVersionName_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 8, oauthClientIdVersionName_);
    }
    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(privateKeyVersionName_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, privateKeyVersionName_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(webhookSecretVersionName_)) {
      size +=
          com.google.protobuf.GeneratedMessageV3.computeStringSize(6, webhookSecretVersionName_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(oauthSecretVersionName_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, oauthSecretVersionName_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(oauthClientIdVersionName_)) {
      size +=
          com.google.protobuf.GeneratedMessageV3.computeStringSize(8, oauthClientIdVersionName_);
    }
    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.cloudbuild.v1.GitHubEnterpriseSecrets)) {
      return super.equals(obj);
    }
    com.google.cloudbuild.v1.GitHubEnterpriseSecrets other =
        (com.google.cloudbuild.v1.GitHubEnterpriseSecrets) obj;

    if (!getPrivateKeyVersionName().equals(other.getPrivateKeyVersionName())) return false;
    if (!getWebhookSecretVersionName().equals(other.getWebhookSecretVersionName())) return false;
    if (!getOauthSecretVersionName().equals(other.getOauthSecretVersionName())) return false;
    if (!getOauthClientIdVersionName().equals(other.getOauthClientIdVersionName())) 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) + PRIVATE_KEY_VERSION_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getPrivateKeyVersionName().hashCode();
    hash = (37 * hash) + WEBHOOK_SECRET_VERSION_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getWebhookSecretVersionName().hashCode();
    hash = (37 * hash) + OAUTH_SECRET_VERSION_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getOauthSecretVersionName().hashCode();
    hash = (37 * hash) + OAUTH_CLIENT_ID_VERSION_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getOauthClientIdVersionName().hashCode();
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

  public static com.google.cloudbuild.v1.GitHubEnterpriseSecrets parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloudbuild.v1.GitHubEnterpriseSecrets parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

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

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

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

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

  public static com.google.cloudbuild.v1.GitHubEnterpriseSecrets 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.cloudbuild.v1.GitHubEnterpriseSecrets 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>
   * GitHubEnterpriseSecrets represents the names of all necessary secrets in
   * Secret Manager for a GitHub Enterprise server.
   * Format is: projects/&lt;project number&gt;/secrets/&lt;secret name&gt;.
   * </pre>
   *
   * Protobuf type {@code google.devtools.cloudbuild.v1.GitHubEnterpriseSecrets}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.devtools.cloudbuild.v1.GitHubEnterpriseSecrets)
      com.google.cloudbuild.v1.GitHubEnterpriseSecretsOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloudbuild.v1.Cloudbuild
          .internal_static_google_devtools_cloudbuild_v1_GitHubEnterpriseSecrets_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloudbuild.v1.Cloudbuild
          .internal_static_google_devtools_cloudbuild_v1_GitHubEnterpriseSecrets_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloudbuild.v1.GitHubEnterpriseSecrets.class,
              com.google.cloudbuild.v1.GitHubEnterpriseSecrets.Builder.class);
    }

    // Construct using com.google.cloudbuild.v1.GitHubEnterpriseSecrets.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      privateKeyVersionName_ = "";
      webhookSecretVersionName_ = "";
      oauthSecretVersionName_ = "";
      oauthClientIdVersionName_ = "";
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloudbuild.v1.Cloudbuild
          .internal_static_google_devtools_cloudbuild_v1_GitHubEnterpriseSecrets_descriptor;
    }

    @java.lang.Override
    public com.google.cloudbuild.v1.GitHubEnterpriseSecrets getDefaultInstanceForType() {
      return com.google.cloudbuild.v1.GitHubEnterpriseSecrets.getDefaultInstance();
    }

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

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

    private void buildPartial0(com.google.cloudbuild.v1.GitHubEnterpriseSecrets result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.privateKeyVersionName_ = privateKeyVersionName_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.webhookSecretVersionName_ = webhookSecretVersionName_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.oauthSecretVersionName_ = oauthSecretVersionName_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.oauthClientIdVersionName_ = oauthClientIdVersionName_;
      }
    }

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

    public Builder mergeFrom(com.google.cloudbuild.v1.GitHubEnterpriseSecrets other) {
      if (other == com.google.cloudbuild.v1.GitHubEnterpriseSecrets.getDefaultInstance())
        return this;
      if (!other.getPrivateKeyVersionName().isEmpty()) {
        privateKeyVersionName_ = other.privateKeyVersionName_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getWebhookSecretVersionName().isEmpty()) {
        webhookSecretVersionName_ = other.webhookSecretVersionName_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (!other.getOauthSecretVersionName().isEmpty()) {
        oauthSecretVersionName_ = other.oauthSecretVersionName_;
        bitField0_ |= 0x00000004;
        onChanged();
      }
      if (!other.getOauthClientIdVersionName().isEmpty()) {
        oauthClientIdVersionName_ = other.oauthClientIdVersionName_;
        bitField0_ |= 0x00000008;
        onChanged();
      }
      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 42:
              {
                privateKeyVersionName_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 42
            case 50:
              {
                webhookSecretVersionName_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 50
            case 58:
              {
                oauthSecretVersionName_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000004;
                break;
              } // case 58
            case 66:
              {
                oauthClientIdVersionName_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000008;
                break;
              } // case 66
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object privateKeyVersionName_ = "";
    /**
     *
     *
     * <pre>
     * The resource name for the private key secret version.
     * </pre>
     *
     * <code>string private_key_version_name = 5 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The privateKeyVersionName.
     */
    public java.lang.String getPrivateKeyVersionName() {
      java.lang.Object ref = privateKeyVersionName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        privateKeyVersionName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name for the private key secret version.
     * </pre>
     *
     * <code>string private_key_version_name = 5 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The bytes for privateKeyVersionName.
     */
    public com.google.protobuf.ByteString getPrivateKeyVersionNameBytes() {
      java.lang.Object ref = privateKeyVersionName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        privateKeyVersionName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name for the private key secret version.
     * </pre>
     *
     * <code>string private_key_version_name = 5 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The privateKeyVersionName to set.
     * @return This builder for chaining.
     */
    public Builder setPrivateKeyVersionName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      privateKeyVersionName_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name for the private key secret version.
     * </pre>
     *
     * <code>string private_key_version_name = 5 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPrivateKeyVersionName() {
      privateKeyVersionName_ = getDefaultInstance().getPrivateKeyVersionName();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name for the private key secret version.
     * </pre>
     *
     * <code>string private_key_version_name = 5 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The bytes for privateKeyVersionName to set.
     * @return This builder for chaining.
     */
    public Builder setPrivateKeyVersionNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      privateKeyVersionName_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private java.lang.Object webhookSecretVersionName_ = "";
    /**
     *
     *
     * <pre>
     * The resource name for the webhook secret secret version in Secret Manager.
     * </pre>
     *
     * <code>string webhook_secret_version_name = 6 [(.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The webhookSecretVersionName.
     */
    public java.lang.String getWebhookSecretVersionName() {
      java.lang.Object ref = webhookSecretVersionName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        webhookSecretVersionName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name for the webhook secret secret version in Secret Manager.
     * </pre>
     *
     * <code>string webhook_secret_version_name = 6 [(.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for webhookSecretVersionName.
     */
    public com.google.protobuf.ByteString getWebhookSecretVersionNameBytes() {
      java.lang.Object ref = webhookSecretVersionName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        webhookSecretVersionName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name for the webhook secret secret version in Secret Manager.
     * </pre>
     *
     * <code>string webhook_secret_version_name = 6 [(.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The webhookSecretVersionName to set.
     * @return This builder for chaining.
     */
    public Builder setWebhookSecretVersionName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      webhookSecretVersionName_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name for the webhook secret secret version in Secret Manager.
     * </pre>
     *
     * <code>string webhook_secret_version_name = 6 [(.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearWebhookSecretVersionName() {
      webhookSecretVersionName_ = getDefaultInstance().getWebhookSecretVersionName();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name for the webhook secret secret version in Secret Manager.
     * </pre>
     *
     * <code>string webhook_secret_version_name = 6 [(.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for webhookSecretVersionName to set.
     * @return This builder for chaining.
     */
    public Builder setWebhookSecretVersionNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      webhookSecretVersionName_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private java.lang.Object oauthSecretVersionName_ = "";
    /**
     *
     *
     * <pre>
     * The resource name for the OAuth secret secret version in Secret Manager.
     * </pre>
     *
     * <code>string oauth_secret_version_name = 7 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The oauthSecretVersionName.
     */
    public java.lang.String getOauthSecretVersionName() {
      java.lang.Object ref = oauthSecretVersionName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        oauthSecretVersionName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name for the OAuth secret secret version in Secret Manager.
     * </pre>
     *
     * <code>string oauth_secret_version_name = 7 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The bytes for oauthSecretVersionName.
     */
    public com.google.protobuf.ByteString getOauthSecretVersionNameBytes() {
      java.lang.Object ref = oauthSecretVersionName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        oauthSecretVersionName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name for the OAuth secret secret version in Secret Manager.
     * </pre>
     *
     * <code>string oauth_secret_version_name = 7 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The oauthSecretVersionName to set.
     * @return This builder for chaining.
     */
    public Builder setOauthSecretVersionName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      oauthSecretVersionName_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name for the OAuth secret secret version in Secret Manager.
     * </pre>
     *
     * <code>string oauth_secret_version_name = 7 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearOauthSecretVersionName() {
      oauthSecretVersionName_ = getDefaultInstance().getOauthSecretVersionName();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name for the OAuth secret secret version in Secret Manager.
     * </pre>
     *
     * <code>string oauth_secret_version_name = 7 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The bytes for oauthSecretVersionName to set.
     * @return This builder for chaining.
     */
    public Builder setOauthSecretVersionNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      oauthSecretVersionName_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    private java.lang.Object oauthClientIdVersionName_ = "";
    /**
     *
     *
     * <pre>
     * The resource name for the OAuth client ID secret version in Secret Manager.
     * </pre>
     *
     * <code>string oauth_client_id_version_name = 8 [(.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The oauthClientIdVersionName.
     */
    public java.lang.String getOauthClientIdVersionName() {
      java.lang.Object ref = oauthClientIdVersionName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        oauthClientIdVersionName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name for the OAuth client ID secret version in Secret Manager.
     * </pre>
     *
     * <code>string oauth_client_id_version_name = 8 [(.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for oauthClientIdVersionName.
     */
    public com.google.protobuf.ByteString getOauthClientIdVersionNameBytes() {
      java.lang.Object ref = oauthClientIdVersionName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        oauthClientIdVersionName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The resource name for the OAuth client ID secret version in Secret Manager.
     * </pre>
     *
     * <code>string oauth_client_id_version_name = 8 [(.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The oauthClientIdVersionName to set.
     * @return This builder for chaining.
     */
    public Builder setOauthClientIdVersionName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      oauthClientIdVersionName_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name for the OAuth client ID secret version in Secret Manager.
     * </pre>
     *
     * <code>string oauth_client_id_version_name = 8 [(.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearOauthClientIdVersionName() {
      oauthClientIdVersionName_ = getDefaultInstance().getOauthClientIdVersionName();
      bitField0_ = (bitField0_ & ~0x00000008);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The resource name for the OAuth client ID secret version in Secret Manager.
     * </pre>
     *
     * <code>string oauth_client_id_version_name = 8 [(.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for oauthClientIdVersionName to set.
     * @return This builder for chaining.
     */
    public Builder setOauthClientIdVersionNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      oauthClientIdVersionName_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

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

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

    // @@protoc_insertion_point(builder_scope:google.devtools.cloudbuild.v1.GitHubEnterpriseSecrets)
  }

  // @@protoc_insertion_point(class_scope:google.devtools.cloudbuild.v1.GitHubEnterpriseSecrets)
  private static final com.google.cloudbuild.v1.GitHubEnterpriseSecrets DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloudbuild.v1.GitHubEnterpriseSecrets();
  }

  public static com.google.cloudbuild.v1.GitHubEnterpriseSecrets getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

  @java.lang.Override
  public com.google.cloudbuild.v1.GitHubEnterpriseSecrets getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
