/*
 * 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/datastream/v1/datastream_resources.proto

package com.google.cloud.datastream.v1;

/**
 *
 *
 * <pre>
 * MySQL SSL configuration information.
 * </pre>
 *
 * Protobuf type {@code google.cloud.datastream.v1.MysqlSslConfig}
 */
public final class MysqlSslConfig extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.datastream.v1.MysqlSslConfig)
    MysqlSslConfigOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use MysqlSslConfig.newBuilder() to construct.
  private MysqlSslConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private MysqlSslConfig() {
    clientKey_ = "";
    clientCertificate_ = "";
    caCertificate_ = "";
  }

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

  @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.datastream.v1.DatastreamResourcesProto
        .internal_static_google_cloud_datastream_v1_MysqlSslConfig_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.datastream.v1.DatastreamResourcesProto
        .internal_static_google_cloud_datastream_v1_MysqlSslConfig_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.datastream.v1.MysqlSslConfig.class,
            com.google.cloud.datastream.v1.MysqlSslConfig.Builder.class);
  }

  public static final int CLIENT_KEY_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object clientKey_ = "";
  /**
   *
   *
   * <pre>
   * Input only. PEM-encoded private key associated with the Client Certificate.
   * If this field is used then the 'client_certificate' and the
   * 'ca_certificate' fields are mandatory.
   * </pre>
   *
   * <code>string client_key = 1 [(.google.api.field_behavior) = INPUT_ONLY];</code>
   *
   * @return The clientKey.
   */
  @java.lang.Override
  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>
   * Input only. PEM-encoded private key associated with the Client Certificate.
   * If this field is used then the 'client_certificate' and the
   * 'ca_certificate' fields are mandatory.
   * </pre>
   *
   * <code>string client_key = 1 [(.google.api.field_behavior) = INPUT_ONLY];</code>
   *
   * @return The bytes for clientKey.
   */
  @java.lang.Override
  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;
    }
  }

  public static final int CLIENT_KEY_SET_FIELD_NUMBER = 2;
  private boolean clientKeySet_ = false;
  /**
   *
   *
   * <pre>
   * Output only. Indicates whether the client_key field is set.
   * </pre>
   *
   * <code>bool client_key_set = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The clientKeySet.
   */
  @java.lang.Override
  public boolean getClientKeySet() {
    return clientKeySet_;
  }

  public static final int CLIENT_CERTIFICATE_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private volatile java.lang.Object clientCertificate_ = "";
  /**
   *
   *
   * <pre>
   * Input only. PEM-encoded certificate that will be used by the replica to
   * authenticate against the source database server. If this field is used
   * then the 'client_key' and the 'ca_certificate' fields are mandatory.
   * </pre>
   *
   * <code>string client_certificate = 3 [(.google.api.field_behavior) = INPUT_ONLY];</code>
   *
   * @return The clientCertificate.
   */
  @java.lang.Override
  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>
   * Input only. PEM-encoded certificate that will be used by the replica to
   * authenticate against the source database server. If this field is used
   * then the 'client_key' and the 'ca_certificate' fields are mandatory.
   * </pre>
   *
   * <code>string client_certificate = 3 [(.google.api.field_behavior) = INPUT_ONLY];</code>
   *
   * @return The bytes for clientCertificate.
   */
  @java.lang.Override
  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_CERTIFICATE_SET_FIELD_NUMBER = 4;
  private boolean clientCertificateSet_ = false;
  /**
   *
   *
   * <pre>
   * Output only. Indicates whether the client_certificate field is set.
   * </pre>
   *
   * <code>bool client_certificate_set = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The clientCertificateSet.
   */
  @java.lang.Override
  public boolean getClientCertificateSet() {
    return clientCertificateSet_;
  }

  public static final int CA_CERTIFICATE_FIELD_NUMBER = 5;

  @SuppressWarnings("serial")
  private volatile java.lang.Object caCertificate_ = "";
  /**
   *
   *
   * <pre>
   * Input only. PEM-encoded certificate of the CA that signed the source
   * database server's certificate.
   * </pre>
   *
   * <code>string ca_certificate = 5 [(.google.api.field_behavior) = INPUT_ONLY];</code>
   *
   * @return The caCertificate.
   */
  @java.lang.Override
  public java.lang.String getCaCertificate() {
    java.lang.Object ref = caCertificate_;
    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();
      caCertificate_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Input only. PEM-encoded certificate of the CA that signed the source
   * database server's certificate.
   * </pre>
   *
   * <code>string ca_certificate = 5 [(.google.api.field_behavior) = INPUT_ONLY];</code>
   *
   * @return The bytes for caCertificate.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getCaCertificateBytes() {
    java.lang.Object ref = caCertificate_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      caCertificate_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CA_CERTIFICATE_SET_FIELD_NUMBER = 6;
  private boolean caCertificateSet_ = false;
  /**
   *
   *
   * <pre>
   * Output only. Indicates whether the ca_certificate field is set.
   * </pre>
   *
   * <code>bool ca_certificate_set = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The caCertificateSet.
   */
  @java.lang.Override
  public boolean getCaCertificateSet() {
    return caCertificateSet_;
  }

  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(clientKey_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clientKey_);
    }
    if (clientKeySet_ != false) {
      output.writeBool(2, clientKeySet_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientCertificate_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, clientCertificate_);
    }
    if (clientCertificateSet_ != false) {
      output.writeBool(4, clientCertificateSet_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(caCertificate_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, caCertificate_);
    }
    if (caCertificateSet_ != false) {
      output.writeBool(6, caCertificateSet_);
    }
    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(clientKey_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clientKey_);
    }
    if (clientKeySet_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, clientKeySet_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clientCertificate_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, clientCertificate_);
    }
    if (clientCertificateSet_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, clientCertificateSet_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(caCertificate_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, caCertificate_);
    }
    if (caCertificateSet_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, caCertificateSet_);
    }
    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.datastream.v1.MysqlSslConfig)) {
      return super.equals(obj);
    }
    com.google.cloud.datastream.v1.MysqlSslConfig other =
        (com.google.cloud.datastream.v1.MysqlSslConfig) obj;

    if (!getClientKey().equals(other.getClientKey())) return false;
    if (getClientKeySet() != other.getClientKeySet()) return false;
    if (!getClientCertificate().equals(other.getClientCertificate())) return false;
    if (getClientCertificateSet() != other.getClientCertificateSet()) return false;
    if (!getCaCertificate().equals(other.getCaCertificate())) return false;
    if (getCaCertificateSet() != other.getCaCertificateSet()) 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) + CLIENT_KEY_FIELD_NUMBER;
    hash = (53 * hash) + getClientKey().hashCode();
    hash = (37 * hash) + CLIENT_KEY_SET_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getClientKeySet());
    hash = (37 * hash) + CLIENT_CERTIFICATE_FIELD_NUMBER;
    hash = (53 * hash) + getClientCertificate().hashCode();
    hash = (37 * hash) + CLIENT_CERTIFICATE_SET_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getClientCertificateSet());
    hash = (37 * hash) + CA_CERTIFICATE_FIELD_NUMBER;
    hash = (53 * hash) + getCaCertificate().hashCode();
    hash = (37 * hash) + CA_CERTIFICATE_SET_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCaCertificateSet());
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

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

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

  public static com.google.cloud.datastream.v1.MysqlSslConfig 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.datastream.v1.MysqlSslConfig 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>
   * MySQL SSL configuration information.
   * </pre>
   *
   * Protobuf type {@code google.cloud.datastream.v1.MysqlSslConfig}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.datastream.v1.MysqlSslConfig)
      com.google.cloud.datastream.v1.MysqlSslConfigOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.datastream.v1.DatastreamResourcesProto
          .internal_static_google_cloud_datastream_v1_MysqlSslConfig_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.datastream.v1.DatastreamResourcesProto
          .internal_static_google_cloud_datastream_v1_MysqlSslConfig_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.datastream.v1.MysqlSslConfig.class,
              com.google.cloud.datastream.v1.MysqlSslConfig.Builder.class);
    }

    // Construct using com.google.cloud.datastream.v1.MysqlSslConfig.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      clientKey_ = "";
      clientKeySet_ = false;
      clientCertificate_ = "";
      clientCertificateSet_ = false;
      caCertificate_ = "";
      caCertificateSet_ = false;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.datastream.v1.DatastreamResourcesProto
          .internal_static_google_cloud_datastream_v1_MysqlSslConfig_descriptor;
    }

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

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

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

    private void buildPartial0(com.google.cloud.datastream.v1.MysqlSslConfig result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.clientKey_ = clientKey_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.clientKeySet_ = clientKeySet_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.clientCertificate_ = clientCertificate_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.clientCertificateSet_ = clientCertificateSet_;
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.caCertificate_ = caCertificate_;
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.caCertificateSet_ = caCertificateSet_;
      }
    }

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

    public Builder mergeFrom(com.google.cloud.datastream.v1.MysqlSslConfig other) {
      if (other == com.google.cloud.datastream.v1.MysqlSslConfig.getDefaultInstance()) return this;
      if (!other.getClientKey().isEmpty()) {
        clientKey_ = other.clientKey_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (other.getClientKeySet() != false) {
        setClientKeySet(other.getClientKeySet());
      }
      if (!other.getClientCertificate().isEmpty()) {
        clientCertificate_ = other.clientCertificate_;
        bitField0_ |= 0x00000004;
        onChanged();
      }
      if (other.getClientCertificateSet() != false) {
        setClientCertificateSet(other.getClientCertificateSet());
      }
      if (!other.getCaCertificate().isEmpty()) {
        caCertificate_ = other.caCertificate_;
        bitField0_ |= 0x00000010;
        onChanged();
      }
      if (other.getCaCertificateSet() != false) {
        setCaCertificateSet(other.getCaCertificateSet());
      }
      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:
              {
                clientKey_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 16:
              {
                clientKeySet_ = input.readBool();
                bitField0_ |= 0x00000002;
                break;
              } // case 16
            case 26:
              {
                clientCertificate_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 32:
              {
                clientCertificateSet_ = input.readBool();
                bitField0_ |= 0x00000008;
                break;
              } // case 32
            case 42:
              {
                caCertificate_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000010;
                break;
              } // case 42
            case 48:
              {
                caCertificateSet_ = input.readBool();
                bitField0_ |= 0x00000020;
                break;
              } // case 48
            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 clientKey_ = "";
    /**
     *
     *
     * <pre>
     * Input only. PEM-encoded private key associated with the Client Certificate.
     * If this field is used then the 'client_certificate' and the
     * 'ca_certificate' fields are mandatory.
     * </pre>
     *
     * <code>string client_key = 1 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     *
     * @return The clientKey.
     */
    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>
     * Input only. PEM-encoded private key associated with the Client Certificate.
     * If this field is used then the 'client_certificate' and the
     * 'ca_certificate' fields are mandatory.
     * </pre>
     *
     * <code>string client_key = 1 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     *
     * @return The bytes for clientKey.
     */
    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>
     * Input only. PEM-encoded private key associated with the Client Certificate.
     * If this field is used then the 'client_certificate' and the
     * 'ca_certificate' fields are mandatory.
     * </pre>
     *
     * <code>string client_key = 1 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     *
     * @param value The clientKey to set.
     * @return This builder for chaining.
     */
    public Builder setClientKey(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      clientKey_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Input only. PEM-encoded private key associated with the Client Certificate.
     * If this field is used then the 'client_certificate' and the
     * 'ca_certificate' fields are mandatory.
     * </pre>
     *
     * <code>string client_key = 1 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearClientKey() {
      clientKey_ = getDefaultInstance().getClientKey();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Input only. PEM-encoded private key associated with the Client Certificate.
     * If this field is used then the 'client_certificate' and the
     * 'ca_certificate' fields are mandatory.
     * </pre>
     *
     * <code>string client_key = 1 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     *
     * @param value The bytes for clientKey to set.
     * @return This builder for chaining.
     */
    public Builder setClientKeyBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      clientKey_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private boolean clientKeySet_;
    /**
     *
     *
     * <pre>
     * Output only. Indicates whether the client_key field is set.
     * </pre>
     *
     * <code>bool client_key_set = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The clientKeySet.
     */
    @java.lang.Override
    public boolean getClientKeySet() {
      return clientKeySet_;
    }
    /**
     *
     *
     * <pre>
     * Output only. Indicates whether the client_key field is set.
     * </pre>
     *
     * <code>bool client_key_set = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The clientKeySet to set.
     * @return This builder for chaining.
     */
    public Builder setClientKeySet(boolean value) {

      clientKeySet_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Indicates whether the client_key field is set.
     * </pre>
     *
     * <code>bool client_key_set = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearClientKeySet() {
      bitField0_ = (bitField0_ & ~0x00000002);
      clientKeySet_ = false;
      onChanged();
      return this;
    }

    private java.lang.Object clientCertificate_ = "";
    /**
     *
     *
     * <pre>
     * Input only. PEM-encoded certificate that will be used by the replica to
     * authenticate against the source database server. If this field is used
     * then the 'client_key' and the 'ca_certificate' fields are mandatory.
     * </pre>
     *
     * <code>string client_certificate = 3 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     *
     * @return The clientCertificate.
     */
    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>
     * Input only. PEM-encoded certificate that will be used by the replica to
     * authenticate against the source database server. If this field is used
     * then the 'client_key' and the 'ca_certificate' fields are mandatory.
     * </pre>
     *
     * <code>string client_certificate = 3 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     *
     * @return The bytes for clientCertificate.
     */
    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>
     * Input only. PEM-encoded certificate that will be used by the replica to
     * authenticate against the source database server. If this field is used
     * then the 'client_key' and the 'ca_certificate' fields are mandatory.
     * </pre>
     *
     * <code>string client_certificate = 3 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     *
     * @param value The clientCertificate to set.
     * @return This builder for chaining.
     */
    public Builder setClientCertificate(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      clientCertificate_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Input only. PEM-encoded certificate that will be used by the replica to
     * authenticate against the source database server. If this field is used
     * then the 'client_key' and the 'ca_certificate' fields are mandatory.
     * </pre>
     *
     * <code>string client_certificate = 3 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearClientCertificate() {
      clientCertificate_ = getDefaultInstance().getClientCertificate();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Input only. PEM-encoded certificate that will be used by the replica to
     * authenticate against the source database server. If this field is used
     * then the 'client_key' and the 'ca_certificate' fields are mandatory.
     * </pre>
     *
     * <code>string client_certificate = 3 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     *
     * @param value The bytes for clientCertificate to set.
     * @return This builder for chaining.
     */
    public Builder setClientCertificateBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      clientCertificate_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    private boolean clientCertificateSet_;
    /**
     *
     *
     * <pre>
     * Output only. Indicates whether the client_certificate field is set.
     * </pre>
     *
     * <code>bool client_certificate_set = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The clientCertificateSet.
     */
    @java.lang.Override
    public boolean getClientCertificateSet() {
      return clientCertificateSet_;
    }
    /**
     *
     *
     * <pre>
     * Output only. Indicates whether the client_certificate field is set.
     * </pre>
     *
     * <code>bool client_certificate_set = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The clientCertificateSet to set.
     * @return This builder for chaining.
     */
    public Builder setClientCertificateSet(boolean value) {

      clientCertificateSet_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Indicates whether the client_certificate field is set.
     * </pre>
     *
     * <code>bool client_certificate_set = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearClientCertificateSet() {
      bitField0_ = (bitField0_ & ~0x00000008);
      clientCertificateSet_ = false;
      onChanged();
      return this;
    }

    private java.lang.Object caCertificate_ = "";
    /**
     *
     *
     * <pre>
     * Input only. PEM-encoded certificate of the CA that signed the source
     * database server's certificate.
     * </pre>
     *
     * <code>string ca_certificate = 5 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     *
     * @return The caCertificate.
     */
    public java.lang.String getCaCertificate() {
      java.lang.Object ref = caCertificate_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        caCertificate_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Input only. PEM-encoded certificate of the CA that signed the source
     * database server's certificate.
     * </pre>
     *
     * <code>string ca_certificate = 5 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     *
     * @return The bytes for caCertificate.
     */
    public com.google.protobuf.ByteString getCaCertificateBytes() {
      java.lang.Object ref = caCertificate_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        caCertificate_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Input only. PEM-encoded certificate of the CA that signed the source
     * database server's certificate.
     * </pre>
     *
     * <code>string ca_certificate = 5 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     *
     * @param value The caCertificate to set.
     * @return This builder for chaining.
     */
    public Builder setCaCertificate(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      caCertificate_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Input only. PEM-encoded certificate of the CA that signed the source
     * database server's certificate.
     * </pre>
     *
     * <code>string ca_certificate = 5 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearCaCertificate() {
      caCertificate_ = getDefaultInstance().getCaCertificate();
      bitField0_ = (bitField0_ & ~0x00000010);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Input only. PEM-encoded certificate of the CA that signed the source
     * database server's certificate.
     * </pre>
     *
     * <code>string ca_certificate = 5 [(.google.api.field_behavior) = INPUT_ONLY];</code>
     *
     * @param value The bytes for caCertificate to set.
     * @return This builder for chaining.
     */
    public Builder setCaCertificateBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      caCertificate_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }

    private boolean caCertificateSet_;
    /**
     *
     *
     * <pre>
     * Output only. Indicates whether the ca_certificate field is set.
     * </pre>
     *
     * <code>bool ca_certificate_set = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The caCertificateSet.
     */
    @java.lang.Override
    public boolean getCaCertificateSet() {
      return caCertificateSet_;
    }
    /**
     *
     *
     * <pre>
     * Output only. Indicates whether the ca_certificate field is set.
     * </pre>
     *
     * <code>bool ca_certificate_set = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The caCertificateSet to set.
     * @return This builder for chaining.
     */
    public Builder setCaCertificateSet(boolean value) {

      caCertificateSet_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Indicates whether the ca_certificate field is set.
     * </pre>
     *
     * <code>bool ca_certificate_set = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearCaCertificateSet() {
      bitField0_ = (bitField0_ & ~0x00000020);
      caCertificateSet_ = false;
      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.cloud.datastream.v1.MysqlSslConfig)
  }

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

  static {
    DEFAULT_INSTANCE = new com.google.cloud.datastream.v1.MysqlSslConfig();
  }

  public static com.google.cloud.datastream.v1.MysqlSslConfig getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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