// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/container/v1/cluster_service.proto

package com.google.container.v1;

/**
 * <pre>
 * The authentication information for accessing the master endpoint.
 * Authentication can be done using HTTP basic auth or using client
 * certificates.
 * </pre>
 *
 * Protobuf type {@code google.container.v1.MasterAuth}
 */
public  final class MasterAuth extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.container.v1.MasterAuth)
    MasterAuthOrBuilder {
private static final long serialVersionUID = 0L;
  // Use MasterAuth.newBuilder() to construct.
  private MasterAuth(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private MasterAuth() {
    username_ = "";
    password_ = "";
    clusterCaCertificate_ = "";
    clientCertificate_ = "";
    clientKey_ = "";
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private MasterAuth(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
          case 10: {
            java.lang.String s = input.readStringRequireUtf8();

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

            password_ = s;
            break;
          }
          case 26: {
            com.google.container.v1.ClientCertificateConfig.Builder subBuilder = null;
            if (clientCertificateConfig_ != null) {
              subBuilder = clientCertificateConfig_.toBuilder();
            }
            clientCertificateConfig_ = input.readMessage(com.google.container.v1.ClientCertificateConfig.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(clientCertificateConfig_);
              clientCertificateConfig_ = subBuilder.buildPartial();
            }

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

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

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

            clientKey_ = s;
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.container.v1.ClusterServiceProto.internal_static_google_container_v1_MasterAuth_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.container.v1.ClusterServiceProto.internal_static_google_container_v1_MasterAuth_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.container.v1.MasterAuth.class, com.google.container.v1.MasterAuth.Builder.class);
  }

  public static final int USERNAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object username_;
  /**
   * <pre>
   * The username to use for HTTP basic authentication to the master endpoint.
   * For clusters v1.6.0 and later, you can disable basic authentication by
   * providing an empty username.
   * </pre>
   *
   * <code>string username = 1;</code>
   */
  public java.lang.String getUsername() {
    java.lang.Object ref = username_;
    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();
      username_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The username to use for HTTP basic authentication to the master endpoint.
   * For clusters v1.6.0 and later, you can disable basic authentication by
   * providing an empty username.
   * </pre>
   *
   * <code>string username = 1;</code>
   */
  public com.google.protobuf.ByteString
      getUsernameBytes() {
    java.lang.Object ref = username_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      username_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PASSWORD_FIELD_NUMBER = 2;
  private volatile java.lang.Object password_;
  /**
   * <pre>
   * The password to use for HTTP basic authentication to the master endpoint.
   * Because the master endpoint is open to the Internet, you should create a
   * strong password.  If a password is provided for cluster creation, username
   * must be non-empty.
   * </pre>
   *
   * <code>string password = 2;</code>
   */
  public java.lang.String getPassword() {
    java.lang.Object ref = password_;
    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();
      password_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The password to use for HTTP basic authentication to the master endpoint.
   * Because the master endpoint is open to the Internet, you should create a
   * strong password.  If a password is provided for cluster creation, username
   * must be non-empty.
   * </pre>
   *
   * <code>string password = 2;</code>
   */
  public com.google.protobuf.ByteString
      getPasswordBytes() {
    java.lang.Object ref = password_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      password_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CLIENT_CERTIFICATE_CONFIG_FIELD_NUMBER = 3;
  private com.google.container.v1.ClientCertificateConfig clientCertificateConfig_;
  /**
   * <pre>
   * Configuration for client certificate authentication on the cluster.  If no
   * configuration is specified, a client certificate is issued.
   * </pre>
   *
   * <code>.google.container.v1.ClientCertificateConfig client_certificate_config = 3;</code>
   */
  public boolean hasClientCertificateConfig() {
    return clientCertificateConfig_ != null;
  }
  /**
   * <pre>
   * Configuration for client certificate authentication on the cluster.  If no
   * configuration is specified, a client certificate is issued.
   * </pre>
   *
   * <code>.google.container.v1.ClientCertificateConfig client_certificate_config = 3;</code>
   */
  public com.google.container.v1.ClientCertificateConfig getClientCertificateConfig() {
    return clientCertificateConfig_ == null ? com.google.container.v1.ClientCertificateConfig.getDefaultInstance() : clientCertificateConfig_;
  }
  /**
   * <pre>
   * Configuration for client certificate authentication on the cluster.  If no
   * configuration is specified, a client certificate is issued.
   * </pre>
   *
   * <code>.google.container.v1.ClientCertificateConfig client_certificate_config = 3;</code>
   */
  public com.google.container.v1.ClientCertificateConfigOrBuilder getClientCertificateConfigOrBuilder() {
    return getClientCertificateConfig();
  }

  public static final int CLUSTER_CA_CERTIFICATE_FIELD_NUMBER = 100;
  private volatile java.lang.Object clusterCaCertificate_;
  /**
   * <pre>
   * [Output only] Base64-encoded public certificate that is the root of
   * trust for the cluster.
   * </pre>
   *
   * <code>string cluster_ca_certificate = 100;</code>
   */
  public java.lang.String getClusterCaCertificate() {
    java.lang.Object ref = clusterCaCertificate_;
    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();
      clusterCaCertificate_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * [Output only] Base64-encoded public certificate that is the root of
   * trust for the cluster.
   * </pre>
   *
   * <code>string cluster_ca_certificate = 100;</code>
   */
  public com.google.protobuf.ByteString
      getClusterCaCertificateBytes() {
    java.lang.Object ref = clusterCaCertificate_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      clusterCaCertificate_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CLIENT_CERTIFICATE_FIELD_NUMBER = 101;
  private volatile java.lang.Object clientCertificate_;
  /**
   * <pre>
   * [Output only] Base64-encoded public certificate used by clients to
   * authenticate to the cluster endpoint.
   * </pre>
   *
   * <code>string client_certificate = 101;</code>
   */
  public java.lang.String getClientCertificate() {
    java.lang.Object ref = clientCertificate_;
    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();
      clientCertificate_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * [Output only] Base64-encoded public certificate used by clients to
   * authenticate to the cluster endpoint.
   * </pre>
   *
   * <code>string client_certificate = 101;</code>
   */
  public com.google.protobuf.ByteString
      getClientCertificateBytes() {
    java.lang.Object ref = clientCertificate_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      clientCertificate_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CLIENT_KEY_FIELD_NUMBER = 102;
  private volatile java.lang.Object clientKey_;
  /**
   * <pre>
   * [Output only] Base64-encoded private key used by clients to authenticate
   * to the cluster endpoint.
   * </pre>
   *
   * <code>string client_key = 102;</code>
   */
  public java.lang.String getClientKey() {
    java.lang.Object ref = clientKey_;
    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();
      clientKey_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * [Output only] Base64-encoded private key used by clients to authenticate
   * to the cluster endpoint.
   * </pre>
   *
   * <code>string client_key = 102;</code>
   */
  public com.google.protobuf.ByteString
      getClientKeyBytes() {
    java.lang.Object ref = clientKey_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      clientKey_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

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

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (!getUsernameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, username_);
    }
    if (!getPasswordBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_);
    }
    if (clientCertificateConfig_ != null) {
      output.writeMessage(3, getClientCertificateConfig());
    }
    if (!getClusterCaCertificateBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 100, clusterCaCertificate_);
    }
    if (!getClientCertificateBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 101, clientCertificate_);
    }
    if (!getClientKeyBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 102, clientKey_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getUsernameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, username_);
    }
    if (!getPasswordBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_);
    }
    if (clientCertificateConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, getClientCertificateConfig());
    }
    if (!getClusterCaCertificateBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(100, clusterCaCertificate_);
    }
    if (!getClientCertificateBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(101, clientCertificate_);
    }
    if (!getClientKeyBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(102, clientKey_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof com.google.container.v1.MasterAuth)) {
      return super.equals(obj);
    }
    com.google.container.v1.MasterAuth other = (com.google.container.v1.MasterAuth) obj;

    boolean result = true;
    result = result && getUsername()
        .equals(other.getUsername());
    result = result && getPassword()
        .equals(other.getPassword());
    result = result && (hasClientCertificateConfig() == other.hasClientCertificateConfig());
    if (hasClientCertificateConfig()) {
      result = result && getClientCertificateConfig()
          .equals(other.getClientCertificateConfig());
    }
    result = result && getClusterCaCertificate()
        .equals(other.getClusterCaCertificate());
    result = result && getClientCertificate()
        .equals(other.getClientCertificate());
    result = result && getClientKey()
        .equals(other.getClientKey());
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + USERNAME_FIELD_NUMBER;
    hash = (53 * hash) + getUsername().hashCode();
    hash = (37 * hash) + PASSWORD_FIELD_NUMBER;
    hash = (53 * hash) + getPassword().hashCode();
    if (hasClientCertificateConfig()) {
      hash = (37 * hash) + CLIENT_CERTIFICATE_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getClientCertificateConfig().hashCode();
    }
    hash = (37 * hash) + CLUSTER_CA_CERTIFICATE_FIELD_NUMBER;
    hash = (53 * hash) + getClusterCaCertificate().hashCode();
    hash = (37 * hash) + CLIENT_CERTIFICATE_FIELD_NUMBER;
    hash = (53 * hash) + getClientCertificate().hashCode();
    hash = (37 * hash) + CLIENT_KEY_FIELD_NUMBER;
    hash = (53 * hash) + getClientKey().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.container.v1.MasterAuth prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   * The authentication information for accessing the master endpoint.
   * Authentication can be done using HTTP basic auth or using client
   * certificates.
   * </pre>
   *
   * Protobuf type {@code google.container.v1.MasterAuth}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.container.v1.MasterAuth)
      com.google.container.v1.MasterAuthOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.container.v1.ClusterServiceProto.internal_static_google_container_v1_MasterAuth_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.container.v1.ClusterServiceProto.internal_static_google_container_v1_MasterAuth_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.container.v1.MasterAuth.class, com.google.container.v1.MasterAuth.Builder.class);
    }

    // Construct using com.google.container.v1.MasterAuth.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

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

      password_ = "";

      if (clientCertificateConfigBuilder_ == null) {
        clientCertificateConfig_ = null;
      } else {
        clientCertificateConfig_ = null;
        clientCertificateConfigBuilder_ = null;
      }
      clusterCaCertificate_ = "";

      clientCertificate_ = "";

      clientKey_ = "";

      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.container.v1.ClusterServiceProto.internal_static_google_container_v1_MasterAuth_descriptor;
    }

    public com.google.container.v1.MasterAuth getDefaultInstanceForType() {
      return com.google.container.v1.MasterAuth.getDefaultInstance();
    }

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

    public com.google.container.v1.MasterAuth buildPartial() {
      com.google.container.v1.MasterAuth result = new com.google.container.v1.MasterAuth(this);
      result.username_ = username_;
      result.password_ = password_;
      if (clientCertificateConfigBuilder_ == null) {
        result.clientCertificateConfig_ = clientCertificateConfig_;
      } else {
        result.clientCertificateConfig_ = clientCertificateConfigBuilder_.build();
      }
      result.clusterCaCertificate_ = clusterCaCertificate_;
      result.clientCertificate_ = clientCertificate_;
      result.clientKey_ = clientKey_;
      onBuilt();
      return result;
    }

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

    public Builder mergeFrom(com.google.container.v1.MasterAuth other) {
      if (other == com.google.container.v1.MasterAuth.getDefaultInstance()) return this;
      if (!other.getUsername().isEmpty()) {
        username_ = other.username_;
        onChanged();
      }
      if (!other.getPassword().isEmpty()) {
        password_ = other.password_;
        onChanged();
      }
      if (other.hasClientCertificateConfig()) {
        mergeClientCertificateConfig(other.getClientCertificateConfig());
      }
      if (!other.getClusterCaCertificate().isEmpty()) {
        clusterCaCertificate_ = other.clusterCaCertificate_;
        onChanged();
      }
      if (!other.getClientCertificate().isEmpty()) {
        clientCertificate_ = other.clientCertificate_;
        onChanged();
      }
      if (!other.getClientKey().isEmpty()) {
        clientKey_ = other.clientKey_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

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

    private java.lang.Object username_ = "";
    /**
     * <pre>
     * The username to use for HTTP basic authentication to the master endpoint.
     * For clusters v1.6.0 and later, you can disable basic authentication by
     * providing an empty username.
     * </pre>
     *
     * <code>string username = 1;</code>
     */
    public java.lang.String getUsername() {
      java.lang.Object ref = username_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        username_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The username to use for HTTP basic authentication to the master endpoint.
     * For clusters v1.6.0 and later, you can disable basic authentication by
     * providing an empty username.
     * </pre>
     *
     * <code>string username = 1;</code>
     */
    public com.google.protobuf.ByteString
        getUsernameBytes() {
      java.lang.Object ref = username_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        username_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The username to use for HTTP basic authentication to the master endpoint.
     * For clusters v1.6.0 and later, you can disable basic authentication by
     * providing an empty username.
     * </pre>
     *
     * <code>string username = 1;</code>
     */
    public Builder setUsername(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      username_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The username to use for HTTP basic authentication to the master endpoint.
     * For clusters v1.6.0 and later, you can disable basic authentication by
     * providing an empty username.
     * </pre>
     *
     * <code>string username = 1;</code>
     */
    public Builder clearUsername() {
      
      username_ = getDefaultInstance().getUsername();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The username to use for HTTP basic authentication to the master endpoint.
     * For clusters v1.6.0 and later, you can disable basic authentication by
     * providing an empty username.
     * </pre>
     *
     * <code>string username = 1;</code>
     */
    public Builder setUsernameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      username_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object password_ = "";
    /**
     * <pre>
     * The password to use for HTTP basic authentication to the master endpoint.
     * Because the master endpoint is open to the Internet, you should create a
     * strong password.  If a password is provided for cluster creation, username
     * must be non-empty.
     * </pre>
     *
     * <code>string password = 2;</code>
     */
    public java.lang.String getPassword() {
      java.lang.Object ref = password_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        password_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The password to use for HTTP basic authentication to the master endpoint.
     * Because the master endpoint is open to the Internet, you should create a
     * strong password.  If a password is provided for cluster creation, username
     * must be non-empty.
     * </pre>
     *
     * <code>string password = 2;</code>
     */
    public com.google.protobuf.ByteString
        getPasswordBytes() {
      java.lang.Object ref = password_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        password_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The password to use for HTTP basic authentication to the master endpoint.
     * Because the master endpoint is open to the Internet, you should create a
     * strong password.  If a password is provided for cluster creation, username
     * must be non-empty.
     * </pre>
     *
     * <code>string password = 2;</code>
     */
    public Builder setPassword(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      password_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The password to use for HTTP basic authentication to the master endpoint.
     * Because the master endpoint is open to the Internet, you should create a
     * strong password.  If a password is provided for cluster creation, username
     * must be non-empty.
     * </pre>
     *
     * <code>string password = 2;</code>
     */
    public Builder clearPassword() {
      
      password_ = getDefaultInstance().getPassword();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The password to use for HTTP basic authentication to the master endpoint.
     * Because the master endpoint is open to the Internet, you should create a
     * strong password.  If a password is provided for cluster creation, username
     * must be non-empty.
     * </pre>
     *
     * <code>string password = 2;</code>
     */
    public Builder setPasswordBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      password_ = value;
      onChanged();
      return this;
    }

    private com.google.container.v1.ClientCertificateConfig clientCertificateConfig_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.container.v1.ClientCertificateConfig, com.google.container.v1.ClientCertificateConfig.Builder, com.google.container.v1.ClientCertificateConfigOrBuilder> clientCertificateConfigBuilder_;
    /**
     * <pre>
     * Configuration for client certificate authentication on the cluster.  If no
     * configuration is specified, a client certificate is issued.
     * </pre>
     *
     * <code>.google.container.v1.ClientCertificateConfig client_certificate_config = 3;</code>
     */
    public boolean hasClientCertificateConfig() {
      return clientCertificateConfigBuilder_ != null || clientCertificateConfig_ != null;
    }
    /**
     * <pre>
     * Configuration for client certificate authentication on the cluster.  If no
     * configuration is specified, a client certificate is issued.
     * </pre>
     *
     * <code>.google.container.v1.ClientCertificateConfig client_certificate_config = 3;</code>
     */
    public com.google.container.v1.ClientCertificateConfig getClientCertificateConfig() {
      if (clientCertificateConfigBuilder_ == null) {
        return clientCertificateConfig_ == null ? com.google.container.v1.ClientCertificateConfig.getDefaultInstance() : clientCertificateConfig_;
      } else {
        return clientCertificateConfigBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Configuration for client certificate authentication on the cluster.  If no
     * configuration is specified, a client certificate is issued.
     * </pre>
     *
     * <code>.google.container.v1.ClientCertificateConfig client_certificate_config = 3;</code>
     */
    public Builder setClientCertificateConfig(com.google.container.v1.ClientCertificateConfig value) {
      if (clientCertificateConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        clientCertificateConfig_ = value;
        onChanged();
      } else {
        clientCertificateConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Configuration for client certificate authentication on the cluster.  If no
     * configuration is specified, a client certificate is issued.
     * </pre>
     *
     * <code>.google.container.v1.ClientCertificateConfig client_certificate_config = 3;</code>
     */
    public Builder setClientCertificateConfig(
        com.google.container.v1.ClientCertificateConfig.Builder builderForValue) {
      if (clientCertificateConfigBuilder_ == null) {
        clientCertificateConfig_ = builderForValue.build();
        onChanged();
      } else {
        clientCertificateConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Configuration for client certificate authentication on the cluster.  If no
     * configuration is specified, a client certificate is issued.
     * </pre>
     *
     * <code>.google.container.v1.ClientCertificateConfig client_certificate_config = 3;</code>
     */
    public Builder mergeClientCertificateConfig(com.google.container.v1.ClientCertificateConfig value) {
      if (clientCertificateConfigBuilder_ == null) {
        if (clientCertificateConfig_ != null) {
          clientCertificateConfig_ =
            com.google.container.v1.ClientCertificateConfig.newBuilder(clientCertificateConfig_).mergeFrom(value).buildPartial();
        } else {
          clientCertificateConfig_ = value;
        }
        onChanged();
      } else {
        clientCertificateConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Configuration for client certificate authentication on the cluster.  If no
     * configuration is specified, a client certificate is issued.
     * </pre>
     *
     * <code>.google.container.v1.ClientCertificateConfig client_certificate_config = 3;</code>
     */
    public Builder clearClientCertificateConfig() {
      if (clientCertificateConfigBuilder_ == null) {
        clientCertificateConfig_ = null;
        onChanged();
      } else {
        clientCertificateConfig_ = null;
        clientCertificateConfigBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Configuration for client certificate authentication on the cluster.  If no
     * configuration is specified, a client certificate is issued.
     * </pre>
     *
     * <code>.google.container.v1.ClientCertificateConfig client_certificate_config = 3;</code>
     */
    public com.google.container.v1.ClientCertificateConfig.Builder getClientCertificateConfigBuilder() {
      
      onChanged();
      return getClientCertificateConfigFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Configuration for client certificate authentication on the cluster.  If no
     * configuration is specified, a client certificate is issued.
     * </pre>
     *
     * <code>.google.container.v1.ClientCertificateConfig client_certificate_config = 3;</code>
     */
    public com.google.container.v1.ClientCertificateConfigOrBuilder getClientCertificateConfigOrBuilder() {
      if (clientCertificateConfigBuilder_ != null) {
        return clientCertificateConfigBuilder_.getMessageOrBuilder();
      } else {
        return clientCertificateConfig_ == null ?
            com.google.container.v1.ClientCertificateConfig.getDefaultInstance() : clientCertificateConfig_;
      }
    }
    /**
     * <pre>
     * Configuration for client certificate authentication on the cluster.  If no
     * configuration is specified, a client certificate is issued.
     * </pre>
     *
     * <code>.google.container.v1.ClientCertificateConfig client_certificate_config = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.container.v1.ClientCertificateConfig, com.google.container.v1.ClientCertificateConfig.Builder, com.google.container.v1.ClientCertificateConfigOrBuilder> 
        getClientCertificateConfigFieldBuilder() {
      if (clientCertificateConfigBuilder_ == null) {
        clientCertificateConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.container.v1.ClientCertificateConfig, com.google.container.v1.ClientCertificateConfig.Builder, com.google.container.v1.ClientCertificateConfigOrBuilder>(
                getClientCertificateConfig(),
                getParentForChildren(),
                isClean());
        clientCertificateConfig_ = null;
      }
      return clientCertificateConfigBuilder_;
    }

    private java.lang.Object clusterCaCertificate_ = "";
    /**
     * <pre>
     * [Output only] Base64-encoded public certificate that is the root of
     * trust for the cluster.
     * </pre>
     *
     * <code>string cluster_ca_certificate = 100;</code>
     */
    public java.lang.String getClusterCaCertificate() {
      java.lang.Object ref = clusterCaCertificate_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        clusterCaCertificate_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * [Output only] Base64-encoded public certificate that is the root of
     * trust for the cluster.
     * </pre>
     *
     * <code>string cluster_ca_certificate = 100;</code>
     */
    public com.google.protobuf.ByteString
        getClusterCaCertificateBytes() {
      java.lang.Object ref = clusterCaCertificate_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        clusterCaCertificate_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * [Output only] Base64-encoded public certificate that is the root of
     * trust for the cluster.
     * </pre>
     *
     * <code>string cluster_ca_certificate = 100;</code>
     */
    public Builder setClusterCaCertificate(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      clusterCaCertificate_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * [Output only] Base64-encoded public certificate that is the root of
     * trust for the cluster.
     * </pre>
     *
     * <code>string cluster_ca_certificate = 100;</code>
     */
    public Builder clearClusterCaCertificate() {
      
      clusterCaCertificate_ = getDefaultInstance().getClusterCaCertificate();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * [Output only] Base64-encoded public certificate that is the root of
     * trust for the cluster.
     * </pre>
     *
     * <code>string cluster_ca_certificate = 100;</code>
     */
    public Builder setClusterCaCertificateBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      clusterCaCertificate_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object clientCertificate_ = "";
    /**
     * <pre>
     * [Output only] Base64-encoded public certificate used by clients to
     * authenticate to the cluster endpoint.
     * </pre>
     *
     * <code>string client_certificate = 101;</code>
     */
    public java.lang.String getClientCertificate() {
      java.lang.Object ref = clientCertificate_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        clientCertificate_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * [Output only] Base64-encoded public certificate used by clients to
     * authenticate to the cluster endpoint.
     * </pre>
     *
     * <code>string client_certificate = 101;</code>
     */
    public com.google.protobuf.ByteString
        getClientCertificateBytes() {
      java.lang.Object ref = clientCertificate_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        clientCertificate_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * [Output only] Base64-encoded public certificate used by clients to
     * authenticate to the cluster endpoint.
     * </pre>
     *
     * <code>string client_certificate = 101;</code>
     */
    public Builder setClientCertificate(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      clientCertificate_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * [Output only] Base64-encoded public certificate used by clients to
     * authenticate to the cluster endpoint.
     * </pre>
     *
     * <code>string client_certificate = 101;</code>
     */
    public Builder clearClientCertificate() {
      
      clientCertificate_ = getDefaultInstance().getClientCertificate();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * [Output only] Base64-encoded public certificate used by clients to
     * authenticate to the cluster endpoint.
     * </pre>
     *
     * <code>string client_certificate = 101;</code>
     */
    public Builder setClientCertificateBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      clientCertificate_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object clientKey_ = "";
    /**
     * <pre>
     * [Output only] Base64-encoded private key used by clients to authenticate
     * to the cluster endpoint.
     * </pre>
     *
     * <code>string client_key = 102;</code>
     */
    public java.lang.String getClientKey() {
      java.lang.Object ref = clientKey_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        clientKey_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * [Output only] Base64-encoded private key used by clients to authenticate
     * to the cluster endpoint.
     * </pre>
     *
     * <code>string client_key = 102;</code>
     */
    public com.google.protobuf.ByteString
        getClientKeyBytes() {
      java.lang.Object ref = clientKey_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        clientKey_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * [Output only] Base64-encoded private key used by clients to authenticate
     * to the cluster endpoint.
     * </pre>
     *
     * <code>string client_key = 102;</code>
     */
    public Builder setClientKey(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      clientKey_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * [Output only] Base64-encoded private key used by clients to authenticate
     * to the cluster endpoint.
     * </pre>
     *
     * <code>string client_key = 102;</code>
     */
    public Builder clearClientKey() {
      
      clientKey_ = getDefaultInstance().getClientKey();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * [Output only] Base64-encoded private key used by clients to authenticate
     * to the cluster endpoint.
     * </pre>
     *
     * <code>string client_key = 102;</code>
     */
    public Builder setClientKeyBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      clientKey_ = value;
      onChanged();
      return this;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

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


    // @@protoc_insertion_point(builder_scope:google.container.v1.MasterAuth)
  }

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

  public static com.google.container.v1.MasterAuth getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  public com.google.container.v1.MasterAuth getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

