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

package com.google.cloud.dataproc.v1;

/**
 * <pre>
 * A request to update a cluster.
 * </pre>
 *
 * Protobuf type {@code google.cloud.dataproc.v1.UpdateClusterRequest}
 */
public  final class UpdateClusterRequest extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.cloud.dataproc.v1.UpdateClusterRequest)
    UpdateClusterRequestOrBuilder {
private static final long serialVersionUID = 0L;
  // Use UpdateClusterRequest.newBuilder() to construct.
  private UpdateClusterRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private UpdateClusterRequest() {
    projectId_ = "";
    region_ = "";
    clusterName_ = "";
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private UpdateClusterRequest(
      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();

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

            clusterName_ = s;
            break;
          }
          case 26: {
            com.google.cloud.dataproc.v1.Cluster.Builder subBuilder = null;
            if (cluster_ != null) {
              subBuilder = cluster_.toBuilder();
            }
            cluster_ = input.readMessage(com.google.cloud.dataproc.v1.Cluster.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(cluster_);
              cluster_ = subBuilder.buildPartial();
            }

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

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

            region_ = s;
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.cloud.dataproc.v1.ClustersProto.internal_static_google_cloud_dataproc_v1_UpdateClusterRequest_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.dataproc.v1.ClustersProto.internal_static_google_cloud_dataproc_v1_UpdateClusterRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.dataproc.v1.UpdateClusterRequest.class, com.google.cloud.dataproc.v1.UpdateClusterRequest.Builder.class);
  }

  public static final int PROJECT_ID_FIELD_NUMBER = 1;
  private volatile java.lang.Object projectId_;
  /**
   * <pre>
   * Required. The ID of the Google Cloud Platform project the
   * cluster belongs to.
   * </pre>
   *
   * <code>string project_id = 1;</code>
   */
  public java.lang.String getProjectId() {
    java.lang.Object ref = projectId_;
    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();
      projectId_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Required. The ID of the Google Cloud Platform project the
   * cluster belongs to.
   * </pre>
   *
   * <code>string project_id = 1;</code>
   */
  public com.google.protobuf.ByteString
      getProjectIdBytes() {
    java.lang.Object ref = projectId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      projectId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int REGION_FIELD_NUMBER = 5;
  private volatile java.lang.Object region_;
  /**
   * <pre>
   * Required. The Cloud Dataproc region in which to handle the request.
   * </pre>
   *
   * <code>string region = 5;</code>
   */
  public java.lang.String getRegion() {
    java.lang.Object ref = region_;
    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();
      region_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Required. The Cloud Dataproc region in which to handle the request.
   * </pre>
   *
   * <code>string region = 5;</code>
   */
  public com.google.protobuf.ByteString
      getRegionBytes() {
    java.lang.Object ref = region_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      region_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CLUSTER_NAME_FIELD_NUMBER = 2;
  private volatile java.lang.Object clusterName_;
  /**
   * <pre>
   * Required. The cluster name.
   * </pre>
   *
   * <code>string cluster_name = 2;</code>
   */
  public java.lang.String getClusterName() {
    java.lang.Object ref = clusterName_;
    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();
      clusterName_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Required. The cluster name.
   * </pre>
   *
   * <code>string cluster_name = 2;</code>
   */
  public com.google.protobuf.ByteString
      getClusterNameBytes() {
    java.lang.Object ref = clusterName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      clusterName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CLUSTER_FIELD_NUMBER = 3;
  private com.google.cloud.dataproc.v1.Cluster cluster_;
  /**
   * <pre>
   * Required. The changes to the cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.Cluster cluster = 3;</code>
   */
  public boolean hasCluster() {
    return cluster_ != null;
  }
  /**
   * <pre>
   * Required. The changes to the cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.Cluster cluster = 3;</code>
   */
  public com.google.cloud.dataproc.v1.Cluster getCluster() {
    return cluster_ == null ? com.google.cloud.dataproc.v1.Cluster.getDefaultInstance() : cluster_;
  }
  /**
   * <pre>
   * Required. The changes to the cluster.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1.Cluster cluster = 3;</code>
   */
  public com.google.cloud.dataproc.v1.ClusterOrBuilder getClusterOrBuilder() {
    return getCluster();
  }

  public static final int UPDATE_MASK_FIELD_NUMBER = 4;
  private com.google.protobuf.FieldMask updateMask_;
  /**
   * <pre>
   * Required. Specifies the path, relative to `Cluster`, of
   * the field to update. For example, to change the number of workers
   * in a cluster to 5, the `update_mask` parameter would be
   * specified as `config.worker_config.num_instances`,
   * and the `PATCH` request body would specify the new value, as follows:
   *     {
   *       "config":{
   *         "workerConfig":{
   *           "numInstances":"5"
   *         }
   *       }
   *     }
   * Similarly, to change the number of preemptible workers in a cluster to 5,
   * the `update_mask` parameter would be
   * `config.secondary_worker_config.num_instances`, and the `PATCH` request
   * body would be set as follows:
   *     {
   *       "config":{
   *         "secondaryWorkerConfig":{
   *           "numInstances":"5"
   *         }
   *       }
   *     }
   * &lt;strong&gt;Note:&lt;/strong&gt; Currently, only the following fields can be updated:
   *  &lt;table&gt;
   *  &lt;tbody&gt;
   *  &lt;tr&gt;
   *  &lt;td&gt;&lt;strong&gt;Mask&lt;/strong&gt;&lt;/td&gt;
   *  &lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
   *  &lt;/tr&gt;
   *  &lt;tr&gt;
   *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;labels&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
   *  &lt;td&gt;Update labels&lt;/td&gt;
   *  &lt;/tr&gt;
   *  &lt;tr&gt;
   *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
   *  &lt;td&gt;Resize primary worker group&lt;/td&gt;
   *  &lt;/tr&gt;
   *  &lt;tr&gt;
   *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.secondary_worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
   *  &lt;td&gt;Resize secondary worker group&lt;/td&gt;
   *  &lt;/tr&gt;
   *  &lt;/tbody&gt;
   *  &lt;/table&gt;
   * </pre>
   *
   * <code>.google.protobuf.FieldMask update_mask = 4;</code>
   */
  public boolean hasUpdateMask() {
    return updateMask_ != null;
  }
  /**
   * <pre>
   * Required. Specifies the path, relative to `Cluster`, of
   * the field to update. For example, to change the number of workers
   * in a cluster to 5, the `update_mask` parameter would be
   * specified as `config.worker_config.num_instances`,
   * and the `PATCH` request body would specify the new value, as follows:
   *     {
   *       "config":{
   *         "workerConfig":{
   *           "numInstances":"5"
   *         }
   *       }
   *     }
   * Similarly, to change the number of preemptible workers in a cluster to 5,
   * the `update_mask` parameter would be
   * `config.secondary_worker_config.num_instances`, and the `PATCH` request
   * body would be set as follows:
   *     {
   *       "config":{
   *         "secondaryWorkerConfig":{
   *           "numInstances":"5"
   *         }
   *       }
   *     }
   * &lt;strong&gt;Note:&lt;/strong&gt; Currently, only the following fields can be updated:
   *  &lt;table&gt;
   *  &lt;tbody&gt;
   *  &lt;tr&gt;
   *  &lt;td&gt;&lt;strong&gt;Mask&lt;/strong&gt;&lt;/td&gt;
   *  &lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
   *  &lt;/tr&gt;
   *  &lt;tr&gt;
   *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;labels&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
   *  &lt;td&gt;Update labels&lt;/td&gt;
   *  &lt;/tr&gt;
   *  &lt;tr&gt;
   *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
   *  &lt;td&gt;Resize primary worker group&lt;/td&gt;
   *  &lt;/tr&gt;
   *  &lt;tr&gt;
   *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.secondary_worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
   *  &lt;td&gt;Resize secondary worker group&lt;/td&gt;
   *  &lt;/tr&gt;
   *  &lt;/tbody&gt;
   *  &lt;/table&gt;
   * </pre>
   *
   * <code>.google.protobuf.FieldMask update_mask = 4;</code>
   */
  public com.google.protobuf.FieldMask getUpdateMask() {
    return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_;
  }
  /**
   * <pre>
   * Required. Specifies the path, relative to `Cluster`, of
   * the field to update. For example, to change the number of workers
   * in a cluster to 5, the `update_mask` parameter would be
   * specified as `config.worker_config.num_instances`,
   * and the `PATCH` request body would specify the new value, as follows:
   *     {
   *       "config":{
   *         "workerConfig":{
   *           "numInstances":"5"
   *         }
   *       }
   *     }
   * Similarly, to change the number of preemptible workers in a cluster to 5,
   * the `update_mask` parameter would be
   * `config.secondary_worker_config.num_instances`, and the `PATCH` request
   * body would be set as follows:
   *     {
   *       "config":{
   *         "secondaryWorkerConfig":{
   *           "numInstances":"5"
   *         }
   *       }
   *     }
   * &lt;strong&gt;Note:&lt;/strong&gt; Currently, only the following fields can be updated:
   *  &lt;table&gt;
   *  &lt;tbody&gt;
   *  &lt;tr&gt;
   *  &lt;td&gt;&lt;strong&gt;Mask&lt;/strong&gt;&lt;/td&gt;
   *  &lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
   *  &lt;/tr&gt;
   *  &lt;tr&gt;
   *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;labels&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
   *  &lt;td&gt;Update labels&lt;/td&gt;
   *  &lt;/tr&gt;
   *  &lt;tr&gt;
   *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
   *  &lt;td&gt;Resize primary worker group&lt;/td&gt;
   *  &lt;/tr&gt;
   *  &lt;tr&gt;
   *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.secondary_worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
   *  &lt;td&gt;Resize secondary worker group&lt;/td&gt;
   *  &lt;/tr&gt;
   *  &lt;/tbody&gt;
   *  &lt;/table&gt;
   * </pre>
   *
   * <code>.google.protobuf.FieldMask update_mask = 4;</code>
   */
  public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() {
    return getUpdateMask();
  }

  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 (!getProjectIdBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectId_);
    }
    if (!getClusterNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clusterName_);
    }
    if (cluster_ != null) {
      output.writeMessage(3, getCluster());
    }
    if (updateMask_ != null) {
      output.writeMessage(4, getUpdateMask());
    }
    if (!getRegionBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, region_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getProjectIdBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectId_);
    }
    if (!getClusterNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, clusterName_);
    }
    if (cluster_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, getCluster());
    }
    if (updateMask_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, getUpdateMask());
    }
    if (!getRegionBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, region_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

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

    boolean result = true;
    result = result && getProjectId()
        .equals(other.getProjectId());
    result = result && getRegion()
        .equals(other.getRegion());
    result = result && getClusterName()
        .equals(other.getClusterName());
    result = result && (hasCluster() == other.hasCluster());
    if (hasCluster()) {
      result = result && getCluster()
          .equals(other.getCluster());
    }
    result = result && (hasUpdateMask() == other.hasUpdateMask());
    if (hasUpdateMask()) {
      result = result && getUpdateMask()
          .equals(other.getUpdateMask());
    }
    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) + PROJECT_ID_FIELD_NUMBER;
    hash = (53 * hash) + getProjectId().hashCode();
    hash = (37 * hash) + REGION_FIELD_NUMBER;
    hash = (53 * hash) + getRegion().hashCode();
    hash = (37 * hash) + CLUSTER_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getClusterName().hashCode();
    if (hasCluster()) {
      hash = (37 * hash) + CLUSTER_FIELD_NUMBER;
      hash = (53 * hash) + getCluster().hashCode();
    }
    if (hasUpdateMask()) {
      hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER;
      hash = (53 * hash) + getUpdateMask().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.cloud.dataproc.v1.UpdateClusterRequest 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>
   * A request to update a cluster.
   * </pre>
   *
   * Protobuf type {@code google.cloud.dataproc.v1.UpdateClusterRequest}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.cloud.dataproc.v1.UpdateClusterRequest)
      com.google.cloud.dataproc.v1.UpdateClusterRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.cloud.dataproc.v1.ClustersProto.internal_static_google_cloud_dataproc_v1_UpdateClusterRequest_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.dataproc.v1.ClustersProto.internal_static_google_cloud_dataproc_v1_UpdateClusterRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.dataproc.v1.UpdateClusterRequest.class, com.google.cloud.dataproc.v1.UpdateClusterRequest.Builder.class);
    }

    // Construct using com.google.cloud.dataproc.v1.UpdateClusterRequest.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();
      projectId_ = "";

      region_ = "";

      clusterName_ = "";

      if (clusterBuilder_ == null) {
        cluster_ = null;
      } else {
        cluster_ = null;
        clusterBuilder_ = null;
      }
      if (updateMaskBuilder_ == null) {
        updateMask_ = null;
      } else {
        updateMask_ = null;
        updateMaskBuilder_ = null;
      }
      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.cloud.dataproc.v1.ClustersProto.internal_static_google_cloud_dataproc_v1_UpdateClusterRequest_descriptor;
    }

    public com.google.cloud.dataproc.v1.UpdateClusterRequest getDefaultInstanceForType() {
      return com.google.cloud.dataproc.v1.UpdateClusterRequest.getDefaultInstance();
    }

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

    public com.google.cloud.dataproc.v1.UpdateClusterRequest buildPartial() {
      com.google.cloud.dataproc.v1.UpdateClusterRequest result = new com.google.cloud.dataproc.v1.UpdateClusterRequest(this);
      result.projectId_ = projectId_;
      result.region_ = region_;
      result.clusterName_ = clusterName_;
      if (clusterBuilder_ == null) {
        result.cluster_ = cluster_;
      } else {
        result.cluster_ = clusterBuilder_.build();
      }
      if (updateMaskBuilder_ == null) {
        result.updateMask_ = updateMask_;
      } else {
        result.updateMask_ = updateMaskBuilder_.build();
      }
      onBuilt();
      return result;
    }

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

    public Builder mergeFrom(com.google.cloud.dataproc.v1.UpdateClusterRequest other) {
      if (other == com.google.cloud.dataproc.v1.UpdateClusterRequest.getDefaultInstance()) return this;
      if (!other.getProjectId().isEmpty()) {
        projectId_ = other.projectId_;
        onChanged();
      }
      if (!other.getRegion().isEmpty()) {
        region_ = other.region_;
        onChanged();
      }
      if (!other.getClusterName().isEmpty()) {
        clusterName_ = other.clusterName_;
        onChanged();
      }
      if (other.hasCluster()) {
        mergeCluster(other.getCluster());
      }
      if (other.hasUpdateMask()) {
        mergeUpdateMask(other.getUpdateMask());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

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

    private java.lang.Object projectId_ = "";
    /**
     * <pre>
     * Required. The ID of the Google Cloud Platform project the
     * cluster belongs to.
     * </pre>
     *
     * <code>string project_id = 1;</code>
     */
    public java.lang.String getProjectId() {
      java.lang.Object ref = projectId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        projectId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Required. The ID of the Google Cloud Platform project the
     * cluster belongs to.
     * </pre>
     *
     * <code>string project_id = 1;</code>
     */
    public com.google.protobuf.ByteString
        getProjectIdBytes() {
      java.lang.Object ref = projectId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        projectId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Required. The ID of the Google Cloud Platform project the
     * cluster belongs to.
     * </pre>
     *
     * <code>string project_id = 1;</code>
     */
    public Builder setProjectId(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      projectId_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Required. The ID of the Google Cloud Platform project the
     * cluster belongs to.
     * </pre>
     *
     * <code>string project_id = 1;</code>
     */
    public Builder clearProjectId() {
      
      projectId_ = getDefaultInstance().getProjectId();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Required. The ID of the Google Cloud Platform project the
     * cluster belongs to.
     * </pre>
     *
     * <code>string project_id = 1;</code>
     */
    public Builder setProjectIdBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      projectId_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object region_ = "";
    /**
     * <pre>
     * Required. The Cloud Dataproc region in which to handle the request.
     * </pre>
     *
     * <code>string region = 5;</code>
     */
    public java.lang.String getRegion() {
      java.lang.Object ref = region_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        region_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Required. The Cloud Dataproc region in which to handle the request.
     * </pre>
     *
     * <code>string region = 5;</code>
     */
    public com.google.protobuf.ByteString
        getRegionBytes() {
      java.lang.Object ref = region_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        region_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Required. The Cloud Dataproc region in which to handle the request.
     * </pre>
     *
     * <code>string region = 5;</code>
     */
    public Builder setRegion(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      region_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Required. The Cloud Dataproc region in which to handle the request.
     * </pre>
     *
     * <code>string region = 5;</code>
     */
    public Builder clearRegion() {
      
      region_ = getDefaultInstance().getRegion();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Required. The Cloud Dataproc region in which to handle the request.
     * </pre>
     *
     * <code>string region = 5;</code>
     */
    public Builder setRegionBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      region_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object clusterName_ = "";
    /**
     * <pre>
     * Required. The cluster name.
     * </pre>
     *
     * <code>string cluster_name = 2;</code>
     */
    public java.lang.String getClusterName() {
      java.lang.Object ref = clusterName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        clusterName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Required. The cluster name.
     * </pre>
     *
     * <code>string cluster_name = 2;</code>
     */
    public com.google.protobuf.ByteString
        getClusterNameBytes() {
      java.lang.Object ref = clusterName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        clusterName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Required. The cluster name.
     * </pre>
     *
     * <code>string cluster_name = 2;</code>
     */
    public Builder setClusterName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      clusterName_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Required. The cluster name.
     * </pre>
     *
     * <code>string cluster_name = 2;</code>
     */
    public Builder clearClusterName() {
      
      clusterName_ = getDefaultInstance().getClusterName();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Required. The cluster name.
     * </pre>
     *
     * <code>string cluster_name = 2;</code>
     */
    public Builder setClusterNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      clusterName_ = value;
      onChanged();
      return this;
    }

    private com.google.cloud.dataproc.v1.Cluster cluster_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.Cluster, com.google.cloud.dataproc.v1.Cluster.Builder, com.google.cloud.dataproc.v1.ClusterOrBuilder> clusterBuilder_;
    /**
     * <pre>
     * Required. The changes to the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.Cluster cluster = 3;</code>
     */
    public boolean hasCluster() {
      return clusterBuilder_ != null || cluster_ != null;
    }
    /**
     * <pre>
     * Required. The changes to the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.Cluster cluster = 3;</code>
     */
    public com.google.cloud.dataproc.v1.Cluster getCluster() {
      if (clusterBuilder_ == null) {
        return cluster_ == null ? com.google.cloud.dataproc.v1.Cluster.getDefaultInstance() : cluster_;
      } else {
        return clusterBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Required. The changes to the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.Cluster cluster = 3;</code>
     */
    public Builder setCluster(com.google.cloud.dataproc.v1.Cluster value) {
      if (clusterBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        cluster_ = value;
        onChanged();
      } else {
        clusterBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Required. The changes to the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.Cluster cluster = 3;</code>
     */
    public Builder setCluster(
        com.google.cloud.dataproc.v1.Cluster.Builder builderForValue) {
      if (clusterBuilder_ == null) {
        cluster_ = builderForValue.build();
        onChanged();
      } else {
        clusterBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Required. The changes to the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.Cluster cluster = 3;</code>
     */
    public Builder mergeCluster(com.google.cloud.dataproc.v1.Cluster value) {
      if (clusterBuilder_ == null) {
        if (cluster_ != null) {
          cluster_ =
            com.google.cloud.dataproc.v1.Cluster.newBuilder(cluster_).mergeFrom(value).buildPartial();
        } else {
          cluster_ = value;
        }
        onChanged();
      } else {
        clusterBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Required. The changes to the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.Cluster cluster = 3;</code>
     */
    public Builder clearCluster() {
      if (clusterBuilder_ == null) {
        cluster_ = null;
        onChanged();
      } else {
        cluster_ = null;
        clusterBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Required. The changes to the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.Cluster cluster = 3;</code>
     */
    public com.google.cloud.dataproc.v1.Cluster.Builder getClusterBuilder() {
      
      onChanged();
      return getClusterFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Required. The changes to the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.Cluster cluster = 3;</code>
     */
    public com.google.cloud.dataproc.v1.ClusterOrBuilder getClusterOrBuilder() {
      if (clusterBuilder_ != null) {
        return clusterBuilder_.getMessageOrBuilder();
      } else {
        return cluster_ == null ?
            com.google.cloud.dataproc.v1.Cluster.getDefaultInstance() : cluster_;
      }
    }
    /**
     * <pre>
     * Required. The changes to the cluster.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1.Cluster cluster = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1.Cluster, com.google.cloud.dataproc.v1.Cluster.Builder, com.google.cloud.dataproc.v1.ClusterOrBuilder> 
        getClusterFieldBuilder() {
      if (clusterBuilder_ == null) {
        clusterBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dataproc.v1.Cluster, com.google.cloud.dataproc.v1.Cluster.Builder, com.google.cloud.dataproc.v1.ClusterOrBuilder>(
                getCluster(),
                getParentForChildren(),
                isClean());
        cluster_ = null;
      }
      return clusterBuilder_;
    }

    private com.google.protobuf.FieldMask updateMask_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_;
    /**
     * <pre>
     * Required. Specifies the path, relative to `Cluster`, of
     * the field to update. For example, to change the number of workers
     * in a cluster to 5, the `update_mask` parameter would be
     * specified as `config.worker_config.num_instances`,
     * and the `PATCH` request body would specify the new value, as follows:
     *     {
     *       "config":{
     *         "workerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * Similarly, to change the number of preemptible workers in a cluster to 5,
     * the `update_mask` parameter would be
     * `config.secondary_worker_config.num_instances`, and the `PATCH` request
     * body would be set as follows:
     *     {
     *       "config":{
     *         "secondaryWorkerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * &lt;strong&gt;Note:&lt;/strong&gt; Currently, only the following fields can be updated:
     *  &lt;table&gt;
     *  &lt;tbody&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;Mask&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;labels&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Update labels&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize primary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.secondary_worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize secondary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;/tbody&gt;
     *  &lt;/table&gt;
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 4;</code>
     */
    public boolean hasUpdateMask() {
      return updateMaskBuilder_ != null || updateMask_ != null;
    }
    /**
     * <pre>
     * Required. Specifies the path, relative to `Cluster`, of
     * the field to update. For example, to change the number of workers
     * in a cluster to 5, the `update_mask` parameter would be
     * specified as `config.worker_config.num_instances`,
     * and the `PATCH` request body would specify the new value, as follows:
     *     {
     *       "config":{
     *         "workerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * Similarly, to change the number of preemptible workers in a cluster to 5,
     * the `update_mask` parameter would be
     * `config.secondary_worker_config.num_instances`, and the `PATCH` request
     * body would be set as follows:
     *     {
     *       "config":{
     *         "secondaryWorkerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * &lt;strong&gt;Note:&lt;/strong&gt; Currently, only the following fields can be updated:
     *  &lt;table&gt;
     *  &lt;tbody&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;Mask&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;labels&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Update labels&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize primary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.secondary_worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize secondary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;/tbody&gt;
     *  &lt;/table&gt;
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 4;</code>
     */
    public com.google.protobuf.FieldMask getUpdateMask() {
      if (updateMaskBuilder_ == null) {
        return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_;
      } else {
        return updateMaskBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Required. Specifies the path, relative to `Cluster`, of
     * the field to update. For example, to change the number of workers
     * in a cluster to 5, the `update_mask` parameter would be
     * specified as `config.worker_config.num_instances`,
     * and the `PATCH` request body would specify the new value, as follows:
     *     {
     *       "config":{
     *         "workerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * Similarly, to change the number of preemptible workers in a cluster to 5,
     * the `update_mask` parameter would be
     * `config.secondary_worker_config.num_instances`, and the `PATCH` request
     * body would be set as follows:
     *     {
     *       "config":{
     *         "secondaryWorkerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * &lt;strong&gt;Note:&lt;/strong&gt; Currently, only the following fields can be updated:
     *  &lt;table&gt;
     *  &lt;tbody&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;Mask&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;labels&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Update labels&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize primary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.secondary_worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize secondary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;/tbody&gt;
     *  &lt;/table&gt;
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 4;</code>
     */
    public Builder setUpdateMask(com.google.protobuf.FieldMask value) {
      if (updateMaskBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        updateMask_ = value;
        onChanged();
      } else {
        updateMaskBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Required. Specifies the path, relative to `Cluster`, of
     * the field to update. For example, to change the number of workers
     * in a cluster to 5, the `update_mask` parameter would be
     * specified as `config.worker_config.num_instances`,
     * and the `PATCH` request body would specify the new value, as follows:
     *     {
     *       "config":{
     *         "workerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * Similarly, to change the number of preemptible workers in a cluster to 5,
     * the `update_mask` parameter would be
     * `config.secondary_worker_config.num_instances`, and the `PATCH` request
     * body would be set as follows:
     *     {
     *       "config":{
     *         "secondaryWorkerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * &lt;strong&gt;Note:&lt;/strong&gt; Currently, only the following fields can be updated:
     *  &lt;table&gt;
     *  &lt;tbody&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;Mask&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;labels&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Update labels&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize primary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.secondary_worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize secondary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;/tbody&gt;
     *  &lt;/table&gt;
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 4;</code>
     */
    public Builder setUpdateMask(
        com.google.protobuf.FieldMask.Builder builderForValue) {
      if (updateMaskBuilder_ == null) {
        updateMask_ = builderForValue.build();
        onChanged();
      } else {
        updateMaskBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Required. Specifies the path, relative to `Cluster`, of
     * the field to update. For example, to change the number of workers
     * in a cluster to 5, the `update_mask` parameter would be
     * specified as `config.worker_config.num_instances`,
     * and the `PATCH` request body would specify the new value, as follows:
     *     {
     *       "config":{
     *         "workerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * Similarly, to change the number of preemptible workers in a cluster to 5,
     * the `update_mask` parameter would be
     * `config.secondary_worker_config.num_instances`, and the `PATCH` request
     * body would be set as follows:
     *     {
     *       "config":{
     *         "secondaryWorkerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * &lt;strong&gt;Note:&lt;/strong&gt; Currently, only the following fields can be updated:
     *  &lt;table&gt;
     *  &lt;tbody&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;Mask&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;labels&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Update labels&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize primary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.secondary_worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize secondary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;/tbody&gt;
     *  &lt;/table&gt;
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 4;</code>
     */
    public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) {
      if (updateMaskBuilder_ == null) {
        if (updateMask_ != null) {
          updateMask_ =
            com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial();
        } else {
          updateMask_ = value;
        }
        onChanged();
      } else {
        updateMaskBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Required. Specifies the path, relative to `Cluster`, of
     * the field to update. For example, to change the number of workers
     * in a cluster to 5, the `update_mask` parameter would be
     * specified as `config.worker_config.num_instances`,
     * and the `PATCH` request body would specify the new value, as follows:
     *     {
     *       "config":{
     *         "workerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * Similarly, to change the number of preemptible workers in a cluster to 5,
     * the `update_mask` parameter would be
     * `config.secondary_worker_config.num_instances`, and the `PATCH` request
     * body would be set as follows:
     *     {
     *       "config":{
     *         "secondaryWorkerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * &lt;strong&gt;Note:&lt;/strong&gt; Currently, only the following fields can be updated:
     *  &lt;table&gt;
     *  &lt;tbody&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;Mask&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;labels&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Update labels&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize primary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.secondary_worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize secondary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;/tbody&gt;
     *  &lt;/table&gt;
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 4;</code>
     */
    public Builder clearUpdateMask() {
      if (updateMaskBuilder_ == null) {
        updateMask_ = null;
        onChanged();
      } else {
        updateMask_ = null;
        updateMaskBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Required. Specifies the path, relative to `Cluster`, of
     * the field to update. For example, to change the number of workers
     * in a cluster to 5, the `update_mask` parameter would be
     * specified as `config.worker_config.num_instances`,
     * and the `PATCH` request body would specify the new value, as follows:
     *     {
     *       "config":{
     *         "workerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * Similarly, to change the number of preemptible workers in a cluster to 5,
     * the `update_mask` parameter would be
     * `config.secondary_worker_config.num_instances`, and the `PATCH` request
     * body would be set as follows:
     *     {
     *       "config":{
     *         "secondaryWorkerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * &lt;strong&gt;Note:&lt;/strong&gt; Currently, only the following fields can be updated:
     *  &lt;table&gt;
     *  &lt;tbody&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;Mask&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;labels&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Update labels&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize primary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.secondary_worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize secondary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;/tbody&gt;
     *  &lt;/table&gt;
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 4;</code>
     */
    public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() {
      
      onChanged();
      return getUpdateMaskFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Required. Specifies the path, relative to `Cluster`, of
     * the field to update. For example, to change the number of workers
     * in a cluster to 5, the `update_mask` parameter would be
     * specified as `config.worker_config.num_instances`,
     * and the `PATCH` request body would specify the new value, as follows:
     *     {
     *       "config":{
     *         "workerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * Similarly, to change the number of preemptible workers in a cluster to 5,
     * the `update_mask` parameter would be
     * `config.secondary_worker_config.num_instances`, and the `PATCH` request
     * body would be set as follows:
     *     {
     *       "config":{
     *         "secondaryWorkerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * &lt;strong&gt;Note:&lt;/strong&gt; Currently, only the following fields can be updated:
     *  &lt;table&gt;
     *  &lt;tbody&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;Mask&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;labels&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Update labels&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize primary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.secondary_worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize secondary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;/tbody&gt;
     *  &lt;/table&gt;
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 4;</code>
     */
    public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() {
      if (updateMaskBuilder_ != null) {
        return updateMaskBuilder_.getMessageOrBuilder();
      } else {
        return updateMask_ == null ?
            com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_;
      }
    }
    /**
     * <pre>
     * Required. Specifies the path, relative to `Cluster`, of
     * the field to update. For example, to change the number of workers
     * in a cluster to 5, the `update_mask` parameter would be
     * specified as `config.worker_config.num_instances`,
     * and the `PATCH` request body would specify the new value, as follows:
     *     {
     *       "config":{
     *         "workerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * Similarly, to change the number of preemptible workers in a cluster to 5,
     * the `update_mask` parameter would be
     * `config.secondary_worker_config.num_instances`, and the `PATCH` request
     * body would be set as follows:
     *     {
     *       "config":{
     *         "secondaryWorkerConfig":{
     *           "numInstances":"5"
     *         }
     *       }
     *     }
     * &lt;strong&gt;Note:&lt;/strong&gt; Currently, only the following fields can be updated:
     *  &lt;table&gt;
     *  &lt;tbody&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;Mask&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;&lt;strong&gt;Purpose&lt;/strong&gt;&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;labels&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Update labels&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize primary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;tr&gt;
     *  &lt;td&gt;&lt;strong&gt;&lt;em&gt;config.secondary_worker_config.num_instances&lt;/em&gt;&lt;/strong&gt;&lt;/td&gt;
     *  &lt;td&gt;Resize secondary worker group&lt;/td&gt;
     *  &lt;/tr&gt;
     *  &lt;/tbody&gt;
     *  &lt;/table&gt;
     * </pre>
     *
     * <code>.google.protobuf.FieldMask update_mask = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> 
        getUpdateMaskFieldBuilder() {
      if (updateMaskBuilder_ == null) {
        updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>(
                getUpdateMask(),
                getParentForChildren(),
                isClean());
        updateMask_ = null;
      }
      return updateMaskBuilder_;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

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


    // @@protoc_insertion_point(builder_scope:google.cloud.dataproc.v1.UpdateClusterRequest)
  }

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

  public static com.google.cloud.dataproc.v1.UpdateClusterRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  public com.google.cloud.dataproc.v1.UpdateClusterRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

