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

package com.google.container.v1;

/**
 *
 *
 * <pre>
 * ClusterUpdate describes an update to the cluster. Exactly one update can
 * be applied to a cluster with each request, so at most one field can be
 * provided.
 * </pre>
 *
 * Protobuf type {@code google.container.v1.ClusterUpdate}
 */
public final class ClusterUpdate extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.container.v1.ClusterUpdate)
    ClusterUpdateOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use ClusterUpdate.newBuilder() to construct.
  private ClusterUpdate(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private ClusterUpdate() {
    desiredNodeVersion_ = "";
    desiredMonitoringService_ = "";
    desiredNodePoolId_ = "";
    desiredImageType_ = "";
    desiredLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    desiredMasterVersion_ = "";
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  private ClusterUpdate(
      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;
          case 34:
            {
              java.lang.String s = input.readStringRequireUtf8();

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

              desiredMonitoringService_ = s;
              break;
            }
          case 50:
            {
              com.google.container.v1.AddonsConfig.Builder subBuilder = null;
              if (desiredAddonsConfig_ != null) {
                subBuilder = desiredAddonsConfig_.toBuilder();
              }
              desiredAddonsConfig_ =
                  input.readMessage(
                      com.google.container.v1.AddonsConfig.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(desiredAddonsConfig_);
                desiredAddonsConfig_ = subBuilder.buildPartial();
              }

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

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

              desiredImageType_ = s;
              break;
            }
          case 74:
            {
              com.google.container.v1.NodePoolAutoscaling.Builder subBuilder = null;
              if (desiredNodePoolAutoscaling_ != null) {
                subBuilder = desiredNodePoolAutoscaling_.toBuilder();
              }
              desiredNodePoolAutoscaling_ =
                  input.readMessage(
                      com.google.container.v1.NodePoolAutoscaling.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(desiredNodePoolAutoscaling_);
                desiredNodePoolAutoscaling_ = subBuilder.buildPartial();
              }

              break;
            }
          case 82:
            {
              java.lang.String s = input.readStringRequireUtf8();
              if (!((mutable_bitField0_ & 0x00000040) != 0)) {
                desiredLocations_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000040;
              }
              desiredLocations_.add(s);
              break;
            }
          case 98:
            {
              com.google.container.v1.MasterAuthorizedNetworksConfig.Builder subBuilder = null;
              if (desiredMasterAuthorizedNetworksConfig_ != null) {
                subBuilder = desiredMasterAuthorizedNetworksConfig_.toBuilder();
              }
              desiredMasterAuthorizedNetworksConfig_ =
                  input.readMessage(
                      com.google.container.v1.MasterAuthorizedNetworksConfig.parser(),
                      extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(desiredMasterAuthorizedNetworksConfig_);
                desiredMasterAuthorizedNetworksConfig_ = subBuilder.buildPartial();
              }

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

              desiredMasterVersion_ = s;
              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              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 {
      if (((mutable_bitField0_ & 0x00000040) != 0)) {
        desiredLocations_ = desiredLocations_.getUnmodifiableView();
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.container.v1.ClusterServiceProto
        .internal_static_google_container_v1_ClusterUpdate_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.container.v1.ClusterServiceProto
        .internal_static_google_container_v1_ClusterUpdate_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.container.v1.ClusterUpdate.class,
            com.google.container.v1.ClusterUpdate.Builder.class);
  }

  private int bitField0_;
  public static final int DESIRED_NODE_VERSION_FIELD_NUMBER = 4;
  private volatile java.lang.Object desiredNodeVersion_;
  /**
   *
   *
   * <pre>
   * The Kubernetes version to change the nodes to (typically an
   * upgrade).
   * Users may specify either explicit versions offered by
   * Kubernetes Engine or version aliases, which have the following behavior:
   * - "latest": picks the highest valid Kubernetes version
   * - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
   * - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
   * - "1.X.Y-gke.N": picks an explicit Kubernetes version
   * - "-": picks the Kubernetes master version
   * </pre>
   *
   * <code>string desired_node_version = 4;</code>
   */
  public java.lang.String getDesiredNodeVersion() {
    java.lang.Object ref = desiredNodeVersion_;
    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();
      desiredNodeVersion_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The Kubernetes version to change the nodes to (typically an
   * upgrade).
   * Users may specify either explicit versions offered by
   * Kubernetes Engine or version aliases, which have the following behavior:
   * - "latest": picks the highest valid Kubernetes version
   * - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
   * - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
   * - "1.X.Y-gke.N": picks an explicit Kubernetes version
   * - "-": picks the Kubernetes master version
   * </pre>
   *
   * <code>string desired_node_version = 4;</code>
   */
  public com.google.protobuf.ByteString getDesiredNodeVersionBytes() {
    java.lang.Object ref = desiredNodeVersion_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      desiredNodeVersion_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DESIRED_MONITORING_SERVICE_FIELD_NUMBER = 5;
  private volatile java.lang.Object desiredMonitoringService_;
  /**
   *
   *
   * <pre>
   * The monitoring service the cluster should use to write metrics.
   * Currently available options:
   * * "monitoring.googleapis.com" - the Google Cloud Monitoring service
   * * "none" - no metrics will be exported from the cluster
   * </pre>
   *
   * <code>string desired_monitoring_service = 5;</code>
   */
  public java.lang.String getDesiredMonitoringService() {
    java.lang.Object ref = desiredMonitoringService_;
    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();
      desiredMonitoringService_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The monitoring service the cluster should use to write metrics.
   * Currently available options:
   * * "monitoring.googleapis.com" - the Google Cloud Monitoring service
   * * "none" - no metrics will be exported from the cluster
   * </pre>
   *
   * <code>string desired_monitoring_service = 5;</code>
   */
  public com.google.protobuf.ByteString getDesiredMonitoringServiceBytes() {
    java.lang.Object ref = desiredMonitoringService_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      desiredMonitoringService_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DESIRED_ADDONS_CONFIG_FIELD_NUMBER = 6;
  private com.google.container.v1.AddonsConfig desiredAddonsConfig_;
  /**
   *
   *
   * <pre>
   * Configurations for the various addons available to run in the cluster.
   * </pre>
   *
   * <code>.google.container.v1.AddonsConfig desired_addons_config = 6;</code>
   */
  public boolean hasDesiredAddonsConfig() {
    return desiredAddonsConfig_ != null;
  }
  /**
   *
   *
   * <pre>
   * Configurations for the various addons available to run in the cluster.
   * </pre>
   *
   * <code>.google.container.v1.AddonsConfig desired_addons_config = 6;</code>
   */
  public com.google.container.v1.AddonsConfig getDesiredAddonsConfig() {
    return desiredAddonsConfig_ == null
        ? com.google.container.v1.AddonsConfig.getDefaultInstance()
        : desiredAddonsConfig_;
  }
  /**
   *
   *
   * <pre>
   * Configurations for the various addons available to run in the cluster.
   * </pre>
   *
   * <code>.google.container.v1.AddonsConfig desired_addons_config = 6;</code>
   */
  public com.google.container.v1.AddonsConfigOrBuilder getDesiredAddonsConfigOrBuilder() {
    return getDesiredAddonsConfig();
  }

  public static final int DESIRED_NODE_POOL_ID_FIELD_NUMBER = 7;
  private volatile java.lang.Object desiredNodePoolId_;
  /**
   *
   *
   * <pre>
   * The node pool to be upgraded. This field is mandatory if
   * "desired_node_version", "desired_image_family" or
   * "desired_node_pool_autoscaling" is specified and there is more than one
   * node pool on the cluster.
   * </pre>
   *
   * <code>string desired_node_pool_id = 7;</code>
   */
  public java.lang.String getDesiredNodePoolId() {
    java.lang.Object ref = desiredNodePoolId_;
    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();
      desiredNodePoolId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The node pool to be upgraded. This field is mandatory if
   * "desired_node_version", "desired_image_family" or
   * "desired_node_pool_autoscaling" is specified and there is more than one
   * node pool on the cluster.
   * </pre>
   *
   * <code>string desired_node_pool_id = 7;</code>
   */
  public com.google.protobuf.ByteString getDesiredNodePoolIdBytes() {
    java.lang.Object ref = desiredNodePoolId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      desiredNodePoolId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DESIRED_IMAGE_TYPE_FIELD_NUMBER = 8;
  private volatile java.lang.Object desiredImageType_;
  /**
   *
   *
   * <pre>
   * The desired image type for the node pool.
   * NOTE: Set the "desired_node_pool" field as well.
   * </pre>
   *
   * <code>string desired_image_type = 8;</code>
   */
  public java.lang.String getDesiredImageType() {
    java.lang.Object ref = desiredImageType_;
    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();
      desiredImageType_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The desired image type for the node pool.
   * NOTE: Set the "desired_node_pool" field as well.
   * </pre>
   *
   * <code>string desired_image_type = 8;</code>
   */
  public com.google.protobuf.ByteString getDesiredImageTypeBytes() {
    java.lang.Object ref = desiredImageType_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      desiredImageType_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DESIRED_NODE_POOL_AUTOSCALING_FIELD_NUMBER = 9;
  private com.google.container.v1.NodePoolAutoscaling desiredNodePoolAutoscaling_;
  /**
   *
   *
   * <pre>
   * Autoscaler configuration for the node pool specified in
   * desired_node_pool_id. If there is only one pool in the
   * cluster and desired_node_pool_id is not provided then
   * the change applies to that single node pool.
   * </pre>
   *
   * <code>.google.container.v1.NodePoolAutoscaling desired_node_pool_autoscaling = 9;</code>
   */
  public boolean hasDesiredNodePoolAutoscaling() {
    return desiredNodePoolAutoscaling_ != null;
  }
  /**
   *
   *
   * <pre>
   * Autoscaler configuration for the node pool specified in
   * desired_node_pool_id. If there is only one pool in the
   * cluster and desired_node_pool_id is not provided then
   * the change applies to that single node pool.
   * </pre>
   *
   * <code>.google.container.v1.NodePoolAutoscaling desired_node_pool_autoscaling = 9;</code>
   */
  public com.google.container.v1.NodePoolAutoscaling getDesiredNodePoolAutoscaling() {
    return desiredNodePoolAutoscaling_ == null
        ? com.google.container.v1.NodePoolAutoscaling.getDefaultInstance()
        : desiredNodePoolAutoscaling_;
  }
  /**
   *
   *
   * <pre>
   * Autoscaler configuration for the node pool specified in
   * desired_node_pool_id. If there is only one pool in the
   * cluster and desired_node_pool_id is not provided then
   * the change applies to that single node pool.
   * </pre>
   *
   * <code>.google.container.v1.NodePoolAutoscaling desired_node_pool_autoscaling = 9;</code>
   */
  public com.google.container.v1.NodePoolAutoscalingOrBuilder
      getDesiredNodePoolAutoscalingOrBuilder() {
    return getDesiredNodePoolAutoscaling();
  }

  public static final int DESIRED_LOCATIONS_FIELD_NUMBER = 10;
  private com.google.protobuf.LazyStringList desiredLocations_;
  /**
   *
   *
   * <pre>
   * The desired list of Google Compute Engine
   * [locations](/compute/docs/zones#available) in which the cluster's nodes
   * should be located. Changing the locations a cluster is in will result
   * in nodes being either created or removed from the cluster, depending on
   * whether locations are being added or removed.
   * This list must always include the cluster's primary zone.
   * </pre>
   *
   * <code>repeated string desired_locations = 10;</code>
   */
  public com.google.protobuf.ProtocolStringList getDesiredLocationsList() {
    return desiredLocations_;
  }
  /**
   *
   *
   * <pre>
   * The desired list of Google Compute Engine
   * [locations](/compute/docs/zones#available) in which the cluster's nodes
   * should be located. Changing the locations a cluster is in will result
   * in nodes being either created or removed from the cluster, depending on
   * whether locations are being added or removed.
   * This list must always include the cluster's primary zone.
   * </pre>
   *
   * <code>repeated string desired_locations = 10;</code>
   */
  public int getDesiredLocationsCount() {
    return desiredLocations_.size();
  }
  /**
   *
   *
   * <pre>
   * The desired list of Google Compute Engine
   * [locations](/compute/docs/zones#available) in which the cluster's nodes
   * should be located. Changing the locations a cluster is in will result
   * in nodes being either created or removed from the cluster, depending on
   * whether locations are being added or removed.
   * This list must always include the cluster's primary zone.
   * </pre>
   *
   * <code>repeated string desired_locations = 10;</code>
   */
  public java.lang.String getDesiredLocations(int index) {
    return desiredLocations_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The desired list of Google Compute Engine
   * [locations](/compute/docs/zones#available) in which the cluster's nodes
   * should be located. Changing the locations a cluster is in will result
   * in nodes being either created or removed from the cluster, depending on
   * whether locations are being added or removed.
   * This list must always include the cluster's primary zone.
   * </pre>
   *
   * <code>repeated string desired_locations = 10;</code>
   */
  public com.google.protobuf.ByteString getDesiredLocationsBytes(int index) {
    return desiredLocations_.getByteString(index);
  }

  public static final int DESIRED_MASTER_AUTHORIZED_NETWORKS_CONFIG_FIELD_NUMBER = 12;
  private com.google.container.v1.MasterAuthorizedNetworksConfig
      desiredMasterAuthorizedNetworksConfig_;
  /**
   *
   *
   * <pre>
   * The desired configuration options for master authorized networks feature.
   * </pre>
   *
   * <code>
   * .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12;
   * </code>
   */
  public boolean hasDesiredMasterAuthorizedNetworksConfig() {
    return desiredMasterAuthorizedNetworksConfig_ != null;
  }
  /**
   *
   *
   * <pre>
   * The desired configuration options for master authorized networks feature.
   * </pre>
   *
   * <code>
   * .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12;
   * </code>
   */
  public com.google.container.v1.MasterAuthorizedNetworksConfig
      getDesiredMasterAuthorizedNetworksConfig() {
    return desiredMasterAuthorizedNetworksConfig_ == null
        ? com.google.container.v1.MasterAuthorizedNetworksConfig.getDefaultInstance()
        : desiredMasterAuthorizedNetworksConfig_;
  }
  /**
   *
   *
   * <pre>
   * The desired configuration options for master authorized networks feature.
   * </pre>
   *
   * <code>
   * .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12;
   * </code>
   */
  public com.google.container.v1.MasterAuthorizedNetworksConfigOrBuilder
      getDesiredMasterAuthorizedNetworksConfigOrBuilder() {
    return getDesiredMasterAuthorizedNetworksConfig();
  }

  public static final int DESIRED_MASTER_VERSION_FIELD_NUMBER = 100;
  private volatile java.lang.Object desiredMasterVersion_;
  /**
   *
   *
   * <pre>
   * The Kubernetes version to change the master to.
   * Users may specify either explicit versions offered by
   * Kubernetes Engine or version aliases, which have the following behavior:
   * - "latest": picks the highest valid Kubernetes version
   * - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
   * - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
   * - "1.X.Y-gke.N": picks an explicit Kubernetes version
   * - "-": picks the default Kubernetes version
   * </pre>
   *
   * <code>string desired_master_version = 100;</code>
   */
  public java.lang.String getDesiredMasterVersion() {
    java.lang.Object ref = desiredMasterVersion_;
    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();
      desiredMasterVersion_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The Kubernetes version to change the master to.
   * Users may specify either explicit versions offered by
   * Kubernetes Engine or version aliases, which have the following behavior:
   * - "latest": picks the highest valid Kubernetes version
   * - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
   * - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
   * - "1.X.Y-gke.N": picks an explicit Kubernetes version
   * - "-": picks the default Kubernetes version
   * </pre>
   *
   * <code>string desired_master_version = 100;</code>
   */
  public com.google.protobuf.ByteString getDesiredMasterVersionBytes() {
    java.lang.Object ref = desiredMasterVersion_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      desiredMasterVersion_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!getDesiredNodeVersionBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, desiredNodeVersion_);
    }
    if (!getDesiredMonitoringServiceBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, desiredMonitoringService_);
    }
    if (desiredAddonsConfig_ != null) {
      output.writeMessage(6, getDesiredAddonsConfig());
    }
    if (!getDesiredNodePoolIdBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 7, desiredNodePoolId_);
    }
    if (!getDesiredImageTypeBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 8, desiredImageType_);
    }
    if (desiredNodePoolAutoscaling_ != null) {
      output.writeMessage(9, getDesiredNodePoolAutoscaling());
    }
    for (int i = 0; i < desiredLocations_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 10, desiredLocations_.getRaw(i));
    }
    if (desiredMasterAuthorizedNetworksConfig_ != null) {
      output.writeMessage(12, getDesiredMasterAuthorizedNetworksConfig());
    }
    if (!getDesiredMasterVersionBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 100, desiredMasterVersion_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getDesiredNodeVersionBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, desiredNodeVersion_);
    }
    if (!getDesiredMonitoringServiceBytes().isEmpty()) {
      size +=
          com.google.protobuf.GeneratedMessageV3.computeStringSize(5, desiredMonitoringService_);
    }
    if (desiredAddonsConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getDesiredAddonsConfig());
    }
    if (!getDesiredNodePoolIdBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, desiredNodePoolId_);
    }
    if (!getDesiredImageTypeBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, desiredImageType_);
    }
    if (desiredNodePoolAutoscaling_ != null) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              9, getDesiredNodePoolAutoscaling());
    }
    {
      int dataSize = 0;
      for (int i = 0; i < desiredLocations_.size(); i++) {
        dataSize += computeStringSizeNoTag(desiredLocations_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getDesiredLocationsList().size();
    }
    if (desiredMasterAuthorizedNetworksConfig_ != null) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              12, getDesiredMasterAuthorizedNetworksConfig());
    }
    if (!getDesiredMasterVersionBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(100, desiredMasterVersion_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

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

    if (!getDesiredNodeVersion().equals(other.getDesiredNodeVersion())) return false;
    if (!getDesiredMonitoringService().equals(other.getDesiredMonitoringService())) return false;
    if (hasDesiredAddonsConfig() != other.hasDesiredAddonsConfig()) return false;
    if (hasDesiredAddonsConfig()) {
      if (!getDesiredAddonsConfig().equals(other.getDesiredAddonsConfig())) return false;
    }
    if (!getDesiredNodePoolId().equals(other.getDesiredNodePoolId())) return false;
    if (!getDesiredImageType().equals(other.getDesiredImageType())) return false;
    if (hasDesiredNodePoolAutoscaling() != other.hasDesiredNodePoolAutoscaling()) return false;
    if (hasDesiredNodePoolAutoscaling()) {
      if (!getDesiredNodePoolAutoscaling().equals(other.getDesiredNodePoolAutoscaling()))
        return false;
    }
    if (!getDesiredLocationsList().equals(other.getDesiredLocationsList())) return false;
    if (hasDesiredMasterAuthorizedNetworksConfig()
        != other.hasDesiredMasterAuthorizedNetworksConfig()) return false;
    if (hasDesiredMasterAuthorizedNetworksConfig()) {
      if (!getDesiredMasterAuthorizedNetworksConfig()
          .equals(other.getDesiredMasterAuthorizedNetworksConfig())) return false;
    }
    if (!getDesiredMasterVersion().equals(other.getDesiredMasterVersion())) return false;
    if (!unknownFields.equals(other.unknownFields)) 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) + DESIRED_NODE_VERSION_FIELD_NUMBER;
    hash = (53 * hash) + getDesiredNodeVersion().hashCode();
    hash = (37 * hash) + DESIRED_MONITORING_SERVICE_FIELD_NUMBER;
    hash = (53 * hash) + getDesiredMonitoringService().hashCode();
    if (hasDesiredAddonsConfig()) {
      hash = (37 * hash) + DESIRED_ADDONS_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getDesiredAddonsConfig().hashCode();
    }
    hash = (37 * hash) + DESIRED_NODE_POOL_ID_FIELD_NUMBER;
    hash = (53 * hash) + getDesiredNodePoolId().hashCode();
    hash = (37 * hash) + DESIRED_IMAGE_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + getDesiredImageType().hashCode();
    if (hasDesiredNodePoolAutoscaling()) {
      hash = (37 * hash) + DESIRED_NODE_POOL_AUTOSCALING_FIELD_NUMBER;
      hash = (53 * hash) + getDesiredNodePoolAutoscaling().hashCode();
    }
    if (getDesiredLocationsCount() > 0) {
      hash = (37 * hash) + DESIRED_LOCATIONS_FIELD_NUMBER;
      hash = (53 * hash) + getDesiredLocationsList().hashCode();
    }
    if (hasDesiredMasterAuthorizedNetworksConfig()) {
      hash = (37 * hash) + DESIRED_MASTER_AUTHORIZED_NETWORKS_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getDesiredMasterAuthorizedNetworksConfig().hashCode();
    }
    hash = (37 * hash) + DESIRED_MASTER_VERSION_FIELD_NUMBER;
    hash = (53 * hash) + getDesiredMasterVersion().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

  public static com.google.container.v1.ClusterUpdate parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.container.v1.ClusterUpdate parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

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

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

  public static com.google.container.v1.ClusterUpdate parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.container.v1.ClusterUpdate parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.container.v1.ClusterUpdate parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.container.v1.ClusterUpdate 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.container.v1.ClusterUpdate 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>
   * ClusterUpdate describes an update to the cluster. Exactly one update can
   * be applied to a cluster with each request, so at most one field can be
   * provided.
   * </pre>
   *
   * Protobuf type {@code google.container.v1.ClusterUpdate}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.container.v1.ClusterUpdate)
      com.google.container.v1.ClusterUpdateOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.container.v1.ClusterServiceProto
          .internal_static_google_container_v1_ClusterUpdate_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.container.v1.ClusterServiceProto
          .internal_static_google_container_v1_ClusterUpdate_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.container.v1.ClusterUpdate.class,
              com.google.container.v1.ClusterUpdate.Builder.class);
    }

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

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      desiredNodeVersion_ = "";

      desiredMonitoringService_ = "";

      if (desiredAddonsConfigBuilder_ == null) {
        desiredAddonsConfig_ = null;
      } else {
        desiredAddonsConfig_ = null;
        desiredAddonsConfigBuilder_ = null;
      }
      desiredNodePoolId_ = "";

      desiredImageType_ = "";

      if (desiredNodePoolAutoscalingBuilder_ == null) {
        desiredNodePoolAutoscaling_ = null;
      } else {
        desiredNodePoolAutoscaling_ = null;
        desiredNodePoolAutoscalingBuilder_ = null;
      }
      desiredLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000040);
      if (desiredMasterAuthorizedNetworksConfigBuilder_ == null) {
        desiredMasterAuthorizedNetworksConfig_ = null;
      } else {
        desiredMasterAuthorizedNetworksConfig_ = null;
        desiredMasterAuthorizedNetworksConfigBuilder_ = null;
      }
      desiredMasterVersion_ = "";

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.container.v1.ClusterServiceProto
          .internal_static_google_container_v1_ClusterUpdate_descriptor;
    }

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

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

    @java.lang.Override
    public com.google.container.v1.ClusterUpdate buildPartial() {
      com.google.container.v1.ClusterUpdate result =
          new com.google.container.v1.ClusterUpdate(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.desiredNodeVersion_ = desiredNodeVersion_;
      result.desiredMonitoringService_ = desiredMonitoringService_;
      if (desiredAddonsConfigBuilder_ == null) {
        result.desiredAddonsConfig_ = desiredAddonsConfig_;
      } else {
        result.desiredAddonsConfig_ = desiredAddonsConfigBuilder_.build();
      }
      result.desiredNodePoolId_ = desiredNodePoolId_;
      result.desiredImageType_ = desiredImageType_;
      if (desiredNodePoolAutoscalingBuilder_ == null) {
        result.desiredNodePoolAutoscaling_ = desiredNodePoolAutoscaling_;
      } else {
        result.desiredNodePoolAutoscaling_ = desiredNodePoolAutoscalingBuilder_.build();
      }
      if (((bitField0_ & 0x00000040) != 0)) {
        desiredLocations_ = desiredLocations_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000040);
      }
      result.desiredLocations_ = desiredLocations_;
      if (desiredMasterAuthorizedNetworksConfigBuilder_ == null) {
        result.desiredMasterAuthorizedNetworksConfig_ = desiredMasterAuthorizedNetworksConfig_;
      } else {
        result.desiredMasterAuthorizedNetworksConfig_ =
            desiredMasterAuthorizedNetworksConfigBuilder_.build();
      }
      result.desiredMasterVersion_ = desiredMasterVersion_;
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

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

    public Builder mergeFrom(com.google.container.v1.ClusterUpdate other) {
      if (other == com.google.container.v1.ClusterUpdate.getDefaultInstance()) return this;
      if (!other.getDesiredNodeVersion().isEmpty()) {
        desiredNodeVersion_ = other.desiredNodeVersion_;
        onChanged();
      }
      if (!other.getDesiredMonitoringService().isEmpty()) {
        desiredMonitoringService_ = other.desiredMonitoringService_;
        onChanged();
      }
      if (other.hasDesiredAddonsConfig()) {
        mergeDesiredAddonsConfig(other.getDesiredAddonsConfig());
      }
      if (!other.getDesiredNodePoolId().isEmpty()) {
        desiredNodePoolId_ = other.desiredNodePoolId_;
        onChanged();
      }
      if (!other.getDesiredImageType().isEmpty()) {
        desiredImageType_ = other.desiredImageType_;
        onChanged();
      }
      if (other.hasDesiredNodePoolAutoscaling()) {
        mergeDesiredNodePoolAutoscaling(other.getDesiredNodePoolAutoscaling());
      }
      if (!other.desiredLocations_.isEmpty()) {
        if (desiredLocations_.isEmpty()) {
          desiredLocations_ = other.desiredLocations_;
          bitField0_ = (bitField0_ & ~0x00000040);
        } else {
          ensureDesiredLocationsIsMutable();
          desiredLocations_.addAll(other.desiredLocations_);
        }
        onChanged();
      }
      if (other.hasDesiredMasterAuthorizedNetworksConfig()) {
        mergeDesiredMasterAuthorizedNetworksConfig(
            other.getDesiredMasterAuthorizedNetworksConfig());
      }
      if (!other.getDesiredMasterVersion().isEmpty()) {
        desiredMasterVersion_ = other.desiredMasterVersion_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.container.v1.ClusterUpdate parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.container.v1.ClusterUpdate) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.lang.Object desiredNodeVersion_ = "";
    /**
     *
     *
     * <pre>
     * The Kubernetes version to change the nodes to (typically an
     * upgrade).
     * Users may specify either explicit versions offered by
     * Kubernetes Engine or version aliases, which have the following behavior:
     * - "latest": picks the highest valid Kubernetes version
     * - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
     * - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
     * - "1.X.Y-gke.N": picks an explicit Kubernetes version
     * - "-": picks the Kubernetes master version
     * </pre>
     *
     * <code>string desired_node_version = 4;</code>
     */
    public java.lang.String getDesiredNodeVersion() {
      java.lang.Object ref = desiredNodeVersion_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        desiredNodeVersion_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The Kubernetes version to change the nodes to (typically an
     * upgrade).
     * Users may specify either explicit versions offered by
     * Kubernetes Engine or version aliases, which have the following behavior:
     * - "latest": picks the highest valid Kubernetes version
     * - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
     * - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
     * - "1.X.Y-gke.N": picks an explicit Kubernetes version
     * - "-": picks the Kubernetes master version
     * </pre>
     *
     * <code>string desired_node_version = 4;</code>
     */
    public com.google.protobuf.ByteString getDesiredNodeVersionBytes() {
      java.lang.Object ref = desiredNodeVersion_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        desiredNodeVersion_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The Kubernetes version to change the nodes to (typically an
     * upgrade).
     * Users may specify either explicit versions offered by
     * Kubernetes Engine or version aliases, which have the following behavior:
     * - "latest": picks the highest valid Kubernetes version
     * - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
     * - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
     * - "1.X.Y-gke.N": picks an explicit Kubernetes version
     * - "-": picks the Kubernetes master version
     * </pre>
     *
     * <code>string desired_node_version = 4;</code>
     */
    public Builder setDesiredNodeVersion(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      desiredNodeVersion_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The Kubernetes version to change the nodes to (typically an
     * upgrade).
     * Users may specify either explicit versions offered by
     * Kubernetes Engine or version aliases, which have the following behavior:
     * - "latest": picks the highest valid Kubernetes version
     * - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
     * - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
     * - "1.X.Y-gke.N": picks an explicit Kubernetes version
     * - "-": picks the Kubernetes master version
     * </pre>
     *
     * <code>string desired_node_version = 4;</code>
     */
    public Builder clearDesiredNodeVersion() {

      desiredNodeVersion_ = getDefaultInstance().getDesiredNodeVersion();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The Kubernetes version to change the nodes to (typically an
     * upgrade).
     * Users may specify either explicit versions offered by
     * Kubernetes Engine or version aliases, which have the following behavior:
     * - "latest": picks the highest valid Kubernetes version
     * - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
     * - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
     * - "1.X.Y-gke.N": picks an explicit Kubernetes version
     * - "-": picks the Kubernetes master version
     * </pre>
     *
     * <code>string desired_node_version = 4;</code>
     */
    public Builder setDesiredNodeVersionBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      desiredNodeVersion_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object desiredMonitoringService_ = "";
    /**
     *
     *
     * <pre>
     * The monitoring service the cluster should use to write metrics.
     * Currently available options:
     * * "monitoring.googleapis.com" - the Google Cloud Monitoring service
     * * "none" - no metrics will be exported from the cluster
     * </pre>
     *
     * <code>string desired_monitoring_service = 5;</code>
     */
    public java.lang.String getDesiredMonitoringService() {
      java.lang.Object ref = desiredMonitoringService_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        desiredMonitoringService_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The monitoring service the cluster should use to write metrics.
     * Currently available options:
     * * "monitoring.googleapis.com" - the Google Cloud Monitoring service
     * * "none" - no metrics will be exported from the cluster
     * </pre>
     *
     * <code>string desired_monitoring_service = 5;</code>
     */
    public com.google.protobuf.ByteString getDesiredMonitoringServiceBytes() {
      java.lang.Object ref = desiredMonitoringService_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        desiredMonitoringService_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The monitoring service the cluster should use to write metrics.
     * Currently available options:
     * * "monitoring.googleapis.com" - the Google Cloud Monitoring service
     * * "none" - no metrics will be exported from the cluster
     * </pre>
     *
     * <code>string desired_monitoring_service = 5;</code>
     */
    public Builder setDesiredMonitoringService(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      desiredMonitoringService_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The monitoring service the cluster should use to write metrics.
     * Currently available options:
     * * "monitoring.googleapis.com" - the Google Cloud Monitoring service
     * * "none" - no metrics will be exported from the cluster
     * </pre>
     *
     * <code>string desired_monitoring_service = 5;</code>
     */
    public Builder clearDesiredMonitoringService() {

      desiredMonitoringService_ = getDefaultInstance().getDesiredMonitoringService();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The monitoring service the cluster should use to write metrics.
     * Currently available options:
     * * "monitoring.googleapis.com" - the Google Cloud Monitoring service
     * * "none" - no metrics will be exported from the cluster
     * </pre>
     *
     * <code>string desired_monitoring_service = 5;</code>
     */
    public Builder setDesiredMonitoringServiceBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      desiredMonitoringService_ = value;
      onChanged();
      return this;
    }

    private com.google.container.v1.AddonsConfig desiredAddonsConfig_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.container.v1.AddonsConfig,
            com.google.container.v1.AddonsConfig.Builder,
            com.google.container.v1.AddonsConfigOrBuilder>
        desiredAddonsConfigBuilder_;
    /**
     *
     *
     * <pre>
     * Configurations for the various addons available to run in the cluster.
     * </pre>
     *
     * <code>.google.container.v1.AddonsConfig desired_addons_config = 6;</code>
     */
    public boolean hasDesiredAddonsConfig() {
      return desiredAddonsConfigBuilder_ != null || desiredAddonsConfig_ != null;
    }
    /**
     *
     *
     * <pre>
     * Configurations for the various addons available to run in the cluster.
     * </pre>
     *
     * <code>.google.container.v1.AddonsConfig desired_addons_config = 6;</code>
     */
    public com.google.container.v1.AddonsConfig getDesiredAddonsConfig() {
      if (desiredAddonsConfigBuilder_ == null) {
        return desiredAddonsConfig_ == null
            ? com.google.container.v1.AddonsConfig.getDefaultInstance()
            : desiredAddonsConfig_;
      } else {
        return desiredAddonsConfigBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Configurations for the various addons available to run in the cluster.
     * </pre>
     *
     * <code>.google.container.v1.AddonsConfig desired_addons_config = 6;</code>
     */
    public Builder setDesiredAddonsConfig(com.google.container.v1.AddonsConfig value) {
      if (desiredAddonsConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        desiredAddonsConfig_ = value;
        onChanged();
      } else {
        desiredAddonsConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Configurations for the various addons available to run in the cluster.
     * </pre>
     *
     * <code>.google.container.v1.AddonsConfig desired_addons_config = 6;</code>
     */
    public Builder setDesiredAddonsConfig(
        com.google.container.v1.AddonsConfig.Builder builderForValue) {
      if (desiredAddonsConfigBuilder_ == null) {
        desiredAddonsConfig_ = builderForValue.build();
        onChanged();
      } else {
        desiredAddonsConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Configurations for the various addons available to run in the cluster.
     * </pre>
     *
     * <code>.google.container.v1.AddonsConfig desired_addons_config = 6;</code>
     */
    public Builder mergeDesiredAddonsConfig(com.google.container.v1.AddonsConfig value) {
      if (desiredAddonsConfigBuilder_ == null) {
        if (desiredAddonsConfig_ != null) {
          desiredAddonsConfig_ =
              com.google.container.v1.AddonsConfig.newBuilder(desiredAddonsConfig_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          desiredAddonsConfig_ = value;
        }
        onChanged();
      } else {
        desiredAddonsConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Configurations for the various addons available to run in the cluster.
     * </pre>
     *
     * <code>.google.container.v1.AddonsConfig desired_addons_config = 6;</code>
     */
    public Builder clearDesiredAddonsConfig() {
      if (desiredAddonsConfigBuilder_ == null) {
        desiredAddonsConfig_ = null;
        onChanged();
      } else {
        desiredAddonsConfig_ = null;
        desiredAddonsConfigBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Configurations for the various addons available to run in the cluster.
     * </pre>
     *
     * <code>.google.container.v1.AddonsConfig desired_addons_config = 6;</code>
     */
    public com.google.container.v1.AddonsConfig.Builder getDesiredAddonsConfigBuilder() {

      onChanged();
      return getDesiredAddonsConfigFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Configurations for the various addons available to run in the cluster.
     * </pre>
     *
     * <code>.google.container.v1.AddonsConfig desired_addons_config = 6;</code>
     */
    public com.google.container.v1.AddonsConfigOrBuilder getDesiredAddonsConfigOrBuilder() {
      if (desiredAddonsConfigBuilder_ != null) {
        return desiredAddonsConfigBuilder_.getMessageOrBuilder();
      } else {
        return desiredAddonsConfig_ == null
            ? com.google.container.v1.AddonsConfig.getDefaultInstance()
            : desiredAddonsConfig_;
      }
    }
    /**
     *
     *
     * <pre>
     * Configurations for the various addons available to run in the cluster.
     * </pre>
     *
     * <code>.google.container.v1.AddonsConfig desired_addons_config = 6;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.container.v1.AddonsConfig,
            com.google.container.v1.AddonsConfig.Builder,
            com.google.container.v1.AddonsConfigOrBuilder>
        getDesiredAddonsConfigFieldBuilder() {
      if (desiredAddonsConfigBuilder_ == null) {
        desiredAddonsConfigBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.container.v1.AddonsConfig,
                com.google.container.v1.AddonsConfig.Builder,
                com.google.container.v1.AddonsConfigOrBuilder>(
                getDesiredAddonsConfig(), getParentForChildren(), isClean());
        desiredAddonsConfig_ = null;
      }
      return desiredAddonsConfigBuilder_;
    }

    private java.lang.Object desiredNodePoolId_ = "";
    /**
     *
     *
     * <pre>
     * The node pool to be upgraded. This field is mandatory if
     * "desired_node_version", "desired_image_family" or
     * "desired_node_pool_autoscaling" is specified and there is more than one
     * node pool on the cluster.
     * </pre>
     *
     * <code>string desired_node_pool_id = 7;</code>
     */
    public java.lang.String getDesiredNodePoolId() {
      java.lang.Object ref = desiredNodePoolId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        desiredNodePoolId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The node pool to be upgraded. This field is mandatory if
     * "desired_node_version", "desired_image_family" or
     * "desired_node_pool_autoscaling" is specified and there is more than one
     * node pool on the cluster.
     * </pre>
     *
     * <code>string desired_node_pool_id = 7;</code>
     */
    public com.google.protobuf.ByteString getDesiredNodePoolIdBytes() {
      java.lang.Object ref = desiredNodePoolId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        desiredNodePoolId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The node pool to be upgraded. This field is mandatory if
     * "desired_node_version", "desired_image_family" or
     * "desired_node_pool_autoscaling" is specified and there is more than one
     * node pool on the cluster.
     * </pre>
     *
     * <code>string desired_node_pool_id = 7;</code>
     */
    public Builder setDesiredNodePoolId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      desiredNodePoolId_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The node pool to be upgraded. This field is mandatory if
     * "desired_node_version", "desired_image_family" or
     * "desired_node_pool_autoscaling" is specified and there is more than one
     * node pool on the cluster.
     * </pre>
     *
     * <code>string desired_node_pool_id = 7;</code>
     */
    public Builder clearDesiredNodePoolId() {

      desiredNodePoolId_ = getDefaultInstance().getDesiredNodePoolId();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The node pool to be upgraded. This field is mandatory if
     * "desired_node_version", "desired_image_family" or
     * "desired_node_pool_autoscaling" is specified and there is more than one
     * node pool on the cluster.
     * </pre>
     *
     * <code>string desired_node_pool_id = 7;</code>
     */
    public Builder setDesiredNodePoolIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      desiredNodePoolId_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object desiredImageType_ = "";
    /**
     *
     *
     * <pre>
     * The desired image type for the node pool.
     * NOTE: Set the "desired_node_pool" field as well.
     * </pre>
     *
     * <code>string desired_image_type = 8;</code>
     */
    public java.lang.String getDesiredImageType() {
      java.lang.Object ref = desiredImageType_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        desiredImageType_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The desired image type for the node pool.
     * NOTE: Set the "desired_node_pool" field as well.
     * </pre>
     *
     * <code>string desired_image_type = 8;</code>
     */
    public com.google.protobuf.ByteString getDesiredImageTypeBytes() {
      java.lang.Object ref = desiredImageType_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        desiredImageType_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The desired image type for the node pool.
     * NOTE: Set the "desired_node_pool" field as well.
     * </pre>
     *
     * <code>string desired_image_type = 8;</code>
     */
    public Builder setDesiredImageType(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      desiredImageType_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The desired image type for the node pool.
     * NOTE: Set the "desired_node_pool" field as well.
     * </pre>
     *
     * <code>string desired_image_type = 8;</code>
     */
    public Builder clearDesiredImageType() {

      desiredImageType_ = getDefaultInstance().getDesiredImageType();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The desired image type for the node pool.
     * NOTE: Set the "desired_node_pool" field as well.
     * </pre>
     *
     * <code>string desired_image_type = 8;</code>
     */
    public Builder setDesiredImageTypeBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      desiredImageType_ = value;
      onChanged();
      return this;
    }

    private com.google.container.v1.NodePoolAutoscaling desiredNodePoolAutoscaling_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.container.v1.NodePoolAutoscaling,
            com.google.container.v1.NodePoolAutoscaling.Builder,
            com.google.container.v1.NodePoolAutoscalingOrBuilder>
        desiredNodePoolAutoscalingBuilder_;
    /**
     *
     *
     * <pre>
     * Autoscaler configuration for the node pool specified in
     * desired_node_pool_id. If there is only one pool in the
     * cluster and desired_node_pool_id is not provided then
     * the change applies to that single node pool.
     * </pre>
     *
     * <code>.google.container.v1.NodePoolAutoscaling desired_node_pool_autoscaling = 9;</code>
     */
    public boolean hasDesiredNodePoolAutoscaling() {
      return desiredNodePoolAutoscalingBuilder_ != null || desiredNodePoolAutoscaling_ != null;
    }
    /**
     *
     *
     * <pre>
     * Autoscaler configuration for the node pool specified in
     * desired_node_pool_id. If there is only one pool in the
     * cluster and desired_node_pool_id is not provided then
     * the change applies to that single node pool.
     * </pre>
     *
     * <code>.google.container.v1.NodePoolAutoscaling desired_node_pool_autoscaling = 9;</code>
     */
    public com.google.container.v1.NodePoolAutoscaling getDesiredNodePoolAutoscaling() {
      if (desiredNodePoolAutoscalingBuilder_ == null) {
        return desiredNodePoolAutoscaling_ == null
            ? com.google.container.v1.NodePoolAutoscaling.getDefaultInstance()
            : desiredNodePoolAutoscaling_;
      } else {
        return desiredNodePoolAutoscalingBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Autoscaler configuration for the node pool specified in
     * desired_node_pool_id. If there is only one pool in the
     * cluster and desired_node_pool_id is not provided then
     * the change applies to that single node pool.
     * </pre>
     *
     * <code>.google.container.v1.NodePoolAutoscaling desired_node_pool_autoscaling = 9;</code>
     */
    public Builder setDesiredNodePoolAutoscaling(
        com.google.container.v1.NodePoolAutoscaling value) {
      if (desiredNodePoolAutoscalingBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        desiredNodePoolAutoscaling_ = value;
        onChanged();
      } else {
        desiredNodePoolAutoscalingBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Autoscaler configuration for the node pool specified in
     * desired_node_pool_id. If there is only one pool in the
     * cluster and desired_node_pool_id is not provided then
     * the change applies to that single node pool.
     * </pre>
     *
     * <code>.google.container.v1.NodePoolAutoscaling desired_node_pool_autoscaling = 9;</code>
     */
    public Builder setDesiredNodePoolAutoscaling(
        com.google.container.v1.NodePoolAutoscaling.Builder builderForValue) {
      if (desiredNodePoolAutoscalingBuilder_ == null) {
        desiredNodePoolAutoscaling_ = builderForValue.build();
        onChanged();
      } else {
        desiredNodePoolAutoscalingBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Autoscaler configuration for the node pool specified in
     * desired_node_pool_id. If there is only one pool in the
     * cluster and desired_node_pool_id is not provided then
     * the change applies to that single node pool.
     * </pre>
     *
     * <code>.google.container.v1.NodePoolAutoscaling desired_node_pool_autoscaling = 9;</code>
     */
    public Builder mergeDesiredNodePoolAutoscaling(
        com.google.container.v1.NodePoolAutoscaling value) {
      if (desiredNodePoolAutoscalingBuilder_ == null) {
        if (desiredNodePoolAutoscaling_ != null) {
          desiredNodePoolAutoscaling_ =
              com.google.container.v1.NodePoolAutoscaling.newBuilder(desiredNodePoolAutoscaling_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          desiredNodePoolAutoscaling_ = value;
        }
        onChanged();
      } else {
        desiredNodePoolAutoscalingBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Autoscaler configuration for the node pool specified in
     * desired_node_pool_id. If there is only one pool in the
     * cluster and desired_node_pool_id is not provided then
     * the change applies to that single node pool.
     * </pre>
     *
     * <code>.google.container.v1.NodePoolAutoscaling desired_node_pool_autoscaling = 9;</code>
     */
    public Builder clearDesiredNodePoolAutoscaling() {
      if (desiredNodePoolAutoscalingBuilder_ == null) {
        desiredNodePoolAutoscaling_ = null;
        onChanged();
      } else {
        desiredNodePoolAutoscaling_ = null;
        desiredNodePoolAutoscalingBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Autoscaler configuration for the node pool specified in
     * desired_node_pool_id. If there is only one pool in the
     * cluster and desired_node_pool_id is not provided then
     * the change applies to that single node pool.
     * </pre>
     *
     * <code>.google.container.v1.NodePoolAutoscaling desired_node_pool_autoscaling = 9;</code>
     */
    public com.google.container.v1.NodePoolAutoscaling.Builder
        getDesiredNodePoolAutoscalingBuilder() {

      onChanged();
      return getDesiredNodePoolAutoscalingFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Autoscaler configuration for the node pool specified in
     * desired_node_pool_id. If there is only one pool in the
     * cluster and desired_node_pool_id is not provided then
     * the change applies to that single node pool.
     * </pre>
     *
     * <code>.google.container.v1.NodePoolAutoscaling desired_node_pool_autoscaling = 9;</code>
     */
    public com.google.container.v1.NodePoolAutoscalingOrBuilder
        getDesiredNodePoolAutoscalingOrBuilder() {
      if (desiredNodePoolAutoscalingBuilder_ != null) {
        return desiredNodePoolAutoscalingBuilder_.getMessageOrBuilder();
      } else {
        return desiredNodePoolAutoscaling_ == null
            ? com.google.container.v1.NodePoolAutoscaling.getDefaultInstance()
            : desiredNodePoolAutoscaling_;
      }
    }
    /**
     *
     *
     * <pre>
     * Autoscaler configuration for the node pool specified in
     * desired_node_pool_id. If there is only one pool in the
     * cluster and desired_node_pool_id is not provided then
     * the change applies to that single node pool.
     * </pre>
     *
     * <code>.google.container.v1.NodePoolAutoscaling desired_node_pool_autoscaling = 9;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.container.v1.NodePoolAutoscaling,
            com.google.container.v1.NodePoolAutoscaling.Builder,
            com.google.container.v1.NodePoolAutoscalingOrBuilder>
        getDesiredNodePoolAutoscalingFieldBuilder() {
      if (desiredNodePoolAutoscalingBuilder_ == null) {
        desiredNodePoolAutoscalingBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.container.v1.NodePoolAutoscaling,
                com.google.container.v1.NodePoolAutoscaling.Builder,
                com.google.container.v1.NodePoolAutoscalingOrBuilder>(
                getDesiredNodePoolAutoscaling(), getParentForChildren(), isClean());
        desiredNodePoolAutoscaling_ = null;
      }
      return desiredNodePoolAutoscalingBuilder_;
    }

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

    private void ensureDesiredLocationsIsMutable() {
      if (!((bitField0_ & 0x00000040) != 0)) {
        desiredLocations_ = new com.google.protobuf.LazyStringArrayList(desiredLocations_);
        bitField0_ |= 0x00000040;
      }
    }
    /**
     *
     *
     * <pre>
     * The desired list of Google Compute Engine
     * [locations](/compute/docs/zones#available) in which the cluster's nodes
     * should be located. Changing the locations a cluster is in will result
     * in nodes being either created or removed from the cluster, depending on
     * whether locations are being added or removed.
     * This list must always include the cluster's primary zone.
     * </pre>
     *
     * <code>repeated string desired_locations = 10;</code>
     */
    public com.google.protobuf.ProtocolStringList getDesiredLocationsList() {
      return desiredLocations_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * The desired list of Google Compute Engine
     * [locations](/compute/docs/zones#available) in which the cluster's nodes
     * should be located. Changing the locations a cluster is in will result
     * in nodes being either created or removed from the cluster, depending on
     * whether locations are being added or removed.
     * This list must always include the cluster's primary zone.
     * </pre>
     *
     * <code>repeated string desired_locations = 10;</code>
     */
    public int getDesiredLocationsCount() {
      return desiredLocations_.size();
    }
    /**
     *
     *
     * <pre>
     * The desired list of Google Compute Engine
     * [locations](/compute/docs/zones#available) in which the cluster's nodes
     * should be located. Changing the locations a cluster is in will result
     * in nodes being either created or removed from the cluster, depending on
     * whether locations are being added or removed.
     * This list must always include the cluster's primary zone.
     * </pre>
     *
     * <code>repeated string desired_locations = 10;</code>
     */
    public java.lang.String getDesiredLocations(int index) {
      return desiredLocations_.get(index);
    }
    /**
     *
     *
     * <pre>
     * The desired list of Google Compute Engine
     * [locations](/compute/docs/zones#available) in which the cluster's nodes
     * should be located. Changing the locations a cluster is in will result
     * in nodes being either created or removed from the cluster, depending on
     * whether locations are being added or removed.
     * This list must always include the cluster's primary zone.
     * </pre>
     *
     * <code>repeated string desired_locations = 10;</code>
     */
    public com.google.protobuf.ByteString getDesiredLocationsBytes(int index) {
      return desiredLocations_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * The desired list of Google Compute Engine
     * [locations](/compute/docs/zones#available) in which the cluster's nodes
     * should be located. Changing the locations a cluster is in will result
     * in nodes being either created or removed from the cluster, depending on
     * whether locations are being added or removed.
     * This list must always include the cluster's primary zone.
     * </pre>
     *
     * <code>repeated string desired_locations = 10;</code>
     */
    public Builder setDesiredLocations(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureDesiredLocationsIsMutable();
      desiredLocations_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The desired list of Google Compute Engine
     * [locations](/compute/docs/zones#available) in which the cluster's nodes
     * should be located. Changing the locations a cluster is in will result
     * in nodes being either created or removed from the cluster, depending on
     * whether locations are being added or removed.
     * This list must always include the cluster's primary zone.
     * </pre>
     *
     * <code>repeated string desired_locations = 10;</code>
     */
    public Builder addDesiredLocations(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureDesiredLocationsIsMutable();
      desiredLocations_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The desired list of Google Compute Engine
     * [locations](/compute/docs/zones#available) in which the cluster's nodes
     * should be located. Changing the locations a cluster is in will result
     * in nodes being either created or removed from the cluster, depending on
     * whether locations are being added or removed.
     * This list must always include the cluster's primary zone.
     * </pre>
     *
     * <code>repeated string desired_locations = 10;</code>
     */
    public Builder addAllDesiredLocations(java.lang.Iterable<java.lang.String> values) {
      ensureDesiredLocationsIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, desiredLocations_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The desired list of Google Compute Engine
     * [locations](/compute/docs/zones#available) in which the cluster's nodes
     * should be located. Changing the locations a cluster is in will result
     * in nodes being either created or removed from the cluster, depending on
     * whether locations are being added or removed.
     * This list must always include the cluster's primary zone.
     * </pre>
     *
     * <code>repeated string desired_locations = 10;</code>
     */
    public Builder clearDesiredLocations() {
      desiredLocations_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000040);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The desired list of Google Compute Engine
     * [locations](/compute/docs/zones#available) in which the cluster's nodes
     * should be located. Changing the locations a cluster is in will result
     * in nodes being either created or removed from the cluster, depending on
     * whether locations are being added or removed.
     * This list must always include the cluster's primary zone.
     * </pre>
     *
     * <code>repeated string desired_locations = 10;</code>
     */
    public Builder addDesiredLocationsBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureDesiredLocationsIsMutable();
      desiredLocations_.add(value);
      onChanged();
      return this;
    }

    private com.google.container.v1.MasterAuthorizedNetworksConfig
        desiredMasterAuthorizedNetworksConfig_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.container.v1.MasterAuthorizedNetworksConfig,
            com.google.container.v1.MasterAuthorizedNetworksConfig.Builder,
            com.google.container.v1.MasterAuthorizedNetworksConfigOrBuilder>
        desiredMasterAuthorizedNetworksConfigBuilder_;
    /**
     *
     *
     * <pre>
     * The desired configuration options for master authorized networks feature.
     * </pre>
     *
     * <code>
     * .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12;
     * </code>
     */
    public boolean hasDesiredMasterAuthorizedNetworksConfig() {
      return desiredMasterAuthorizedNetworksConfigBuilder_ != null
          || desiredMasterAuthorizedNetworksConfig_ != null;
    }
    /**
     *
     *
     * <pre>
     * The desired configuration options for master authorized networks feature.
     * </pre>
     *
     * <code>
     * .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12;
     * </code>
     */
    public com.google.container.v1.MasterAuthorizedNetworksConfig
        getDesiredMasterAuthorizedNetworksConfig() {
      if (desiredMasterAuthorizedNetworksConfigBuilder_ == null) {
        return desiredMasterAuthorizedNetworksConfig_ == null
            ? com.google.container.v1.MasterAuthorizedNetworksConfig.getDefaultInstance()
            : desiredMasterAuthorizedNetworksConfig_;
      } else {
        return desiredMasterAuthorizedNetworksConfigBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The desired configuration options for master authorized networks feature.
     * </pre>
     *
     * <code>
     * .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12;
     * </code>
     */
    public Builder setDesiredMasterAuthorizedNetworksConfig(
        com.google.container.v1.MasterAuthorizedNetworksConfig value) {
      if (desiredMasterAuthorizedNetworksConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        desiredMasterAuthorizedNetworksConfig_ = value;
        onChanged();
      } else {
        desiredMasterAuthorizedNetworksConfigBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The desired configuration options for master authorized networks feature.
     * </pre>
     *
     * <code>
     * .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12;
     * </code>
     */
    public Builder setDesiredMasterAuthorizedNetworksConfig(
        com.google.container.v1.MasterAuthorizedNetworksConfig.Builder builderForValue) {
      if (desiredMasterAuthorizedNetworksConfigBuilder_ == null) {
        desiredMasterAuthorizedNetworksConfig_ = builderForValue.build();
        onChanged();
      } else {
        desiredMasterAuthorizedNetworksConfigBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The desired configuration options for master authorized networks feature.
     * </pre>
     *
     * <code>
     * .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12;
     * </code>
     */
    public Builder mergeDesiredMasterAuthorizedNetworksConfig(
        com.google.container.v1.MasterAuthorizedNetworksConfig value) {
      if (desiredMasterAuthorizedNetworksConfigBuilder_ == null) {
        if (desiredMasterAuthorizedNetworksConfig_ != null) {
          desiredMasterAuthorizedNetworksConfig_ =
              com.google.container.v1.MasterAuthorizedNetworksConfig.newBuilder(
                      desiredMasterAuthorizedNetworksConfig_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          desiredMasterAuthorizedNetworksConfig_ = value;
        }
        onChanged();
      } else {
        desiredMasterAuthorizedNetworksConfigBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The desired configuration options for master authorized networks feature.
     * </pre>
     *
     * <code>
     * .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12;
     * </code>
     */
    public Builder clearDesiredMasterAuthorizedNetworksConfig() {
      if (desiredMasterAuthorizedNetworksConfigBuilder_ == null) {
        desiredMasterAuthorizedNetworksConfig_ = null;
        onChanged();
      } else {
        desiredMasterAuthorizedNetworksConfig_ = null;
        desiredMasterAuthorizedNetworksConfigBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The desired configuration options for master authorized networks feature.
     * </pre>
     *
     * <code>
     * .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12;
     * </code>
     */
    public com.google.container.v1.MasterAuthorizedNetworksConfig.Builder
        getDesiredMasterAuthorizedNetworksConfigBuilder() {

      onChanged();
      return getDesiredMasterAuthorizedNetworksConfigFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The desired configuration options for master authorized networks feature.
     * </pre>
     *
     * <code>
     * .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12;
     * </code>
     */
    public com.google.container.v1.MasterAuthorizedNetworksConfigOrBuilder
        getDesiredMasterAuthorizedNetworksConfigOrBuilder() {
      if (desiredMasterAuthorizedNetworksConfigBuilder_ != null) {
        return desiredMasterAuthorizedNetworksConfigBuilder_.getMessageOrBuilder();
      } else {
        return desiredMasterAuthorizedNetworksConfig_ == null
            ? com.google.container.v1.MasterAuthorizedNetworksConfig.getDefaultInstance()
            : desiredMasterAuthorizedNetworksConfig_;
      }
    }
    /**
     *
     *
     * <pre>
     * The desired configuration options for master authorized networks feature.
     * </pre>
     *
     * <code>
     * .google.container.v1.MasterAuthorizedNetworksConfig desired_master_authorized_networks_config = 12;
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.container.v1.MasterAuthorizedNetworksConfig,
            com.google.container.v1.MasterAuthorizedNetworksConfig.Builder,
            com.google.container.v1.MasterAuthorizedNetworksConfigOrBuilder>
        getDesiredMasterAuthorizedNetworksConfigFieldBuilder() {
      if (desiredMasterAuthorizedNetworksConfigBuilder_ == null) {
        desiredMasterAuthorizedNetworksConfigBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.container.v1.MasterAuthorizedNetworksConfig,
                com.google.container.v1.MasterAuthorizedNetworksConfig.Builder,
                com.google.container.v1.MasterAuthorizedNetworksConfigOrBuilder>(
                getDesiredMasterAuthorizedNetworksConfig(), getParentForChildren(), isClean());
        desiredMasterAuthorizedNetworksConfig_ = null;
      }
      return desiredMasterAuthorizedNetworksConfigBuilder_;
    }

    private java.lang.Object desiredMasterVersion_ = "";
    /**
     *
     *
     * <pre>
     * The Kubernetes version to change the master to.
     * Users may specify either explicit versions offered by
     * Kubernetes Engine or version aliases, which have the following behavior:
     * - "latest": picks the highest valid Kubernetes version
     * - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
     * - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
     * - "1.X.Y-gke.N": picks an explicit Kubernetes version
     * - "-": picks the default Kubernetes version
     * </pre>
     *
     * <code>string desired_master_version = 100;</code>
     */
    public java.lang.String getDesiredMasterVersion() {
      java.lang.Object ref = desiredMasterVersion_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        desiredMasterVersion_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The Kubernetes version to change the master to.
     * Users may specify either explicit versions offered by
     * Kubernetes Engine or version aliases, which have the following behavior:
     * - "latest": picks the highest valid Kubernetes version
     * - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
     * - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
     * - "1.X.Y-gke.N": picks an explicit Kubernetes version
     * - "-": picks the default Kubernetes version
     * </pre>
     *
     * <code>string desired_master_version = 100;</code>
     */
    public com.google.protobuf.ByteString getDesiredMasterVersionBytes() {
      java.lang.Object ref = desiredMasterVersion_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        desiredMasterVersion_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The Kubernetes version to change the master to.
     * Users may specify either explicit versions offered by
     * Kubernetes Engine or version aliases, which have the following behavior:
     * - "latest": picks the highest valid Kubernetes version
     * - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
     * - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
     * - "1.X.Y-gke.N": picks an explicit Kubernetes version
     * - "-": picks the default Kubernetes version
     * </pre>
     *
     * <code>string desired_master_version = 100;</code>
     */
    public Builder setDesiredMasterVersion(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      desiredMasterVersion_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The Kubernetes version to change the master to.
     * Users may specify either explicit versions offered by
     * Kubernetes Engine or version aliases, which have the following behavior:
     * - "latest": picks the highest valid Kubernetes version
     * - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
     * - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
     * - "1.X.Y-gke.N": picks an explicit Kubernetes version
     * - "-": picks the default Kubernetes version
     * </pre>
     *
     * <code>string desired_master_version = 100;</code>
     */
    public Builder clearDesiredMasterVersion() {

      desiredMasterVersion_ = getDefaultInstance().getDesiredMasterVersion();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The Kubernetes version to change the master to.
     * Users may specify either explicit versions offered by
     * Kubernetes Engine or version aliases, which have the following behavior:
     * - "latest": picks the highest valid Kubernetes version
     * - "1.X": picks the highest valid patch+gke.N patch in the 1.X version
     * - "1.X.Y": picks the highest valid gke.N patch in the 1.X.Y version
     * - "1.X.Y-gke.N": picks an explicit Kubernetes version
     * - "-": picks the default Kubernetes version
     * </pre>
     *
     * <code>string desired_master_version = 100;</code>
     */
    public Builder setDesiredMasterVersionBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      desiredMasterVersion_ = value;
      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.container.v1.ClusterUpdate)
  }

  // @@protoc_insertion_point(class_scope:google.container.v1.ClusterUpdate)
  private static final com.google.container.v1.ClusterUpdate DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.container.v1.ClusterUpdate();
  }

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

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

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

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

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