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

package com.google.cloud.dataproc.v1;

/**
 *
 *
 * <pre>
 * Common config settings for resources of Compute Engine cluster
 * instances, applicable to all instances in the cluster.
 * </pre>
 *
 * Protobuf type {@code google.cloud.dataproc.v1.GceClusterConfig}
 */
public final class GceClusterConfig extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.dataproc.v1.GceClusterConfig)
    GceClusterConfigOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use GceClusterConfig.newBuilder() to construct.
  private GceClusterConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private GceClusterConfig() {
    zoneUri_ = "";
    networkUri_ = "";
    subnetworkUri_ = "";
    internalIpOnly_ = false;
    serviceAccount_ = "";
    serviceAccountScopes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    tags_ = com.google.protobuf.LazyStringArrayList.EMPTY;
  }

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

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

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

              networkUri_ = s;
              break;
            }
          case 26:
            {
              java.lang.String s = input.readStringRequireUtf8();
              if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
                serviceAccountScopes_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000020;
              }
              serviceAccountScopes_.add(s);
              break;
            }
          case 34:
            {
              java.lang.String s = input.readStringRequireUtf8();
              if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
                tags_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000040;
              }
              tags_.add(s);
              break;
            }
          case 42:
            {
              if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) {
                metadata_ =
                    com.google.protobuf.MapField.newMapField(
                        MetadataDefaultEntryHolder.defaultEntry);
                mutable_bitField0_ |= 0x00000080;
              }
              com.google.protobuf.MapEntry<java.lang.String, java.lang.String> metadata__ =
                  input.readMessage(
                      MetadataDefaultEntryHolder.defaultEntry.getParserForType(),
                      extensionRegistry);
              metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue());
              break;
            }
          case 50:
            {
              java.lang.String s = input.readStringRequireUtf8();

              subnetworkUri_ = s;
              break;
            }
          case 56:
            {
              internalIpOnly_ = input.readBool();
              break;
            }
          case 66:
            {
              java.lang.String s = input.readStringRequireUtf8();

              serviceAccount_ = s;
              break;
            }
          default:
            {
              if (!parseUnknownFieldProto3(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_ & 0x00000020) == 0x00000020)) {
        serviceAccountScopes_ = serviceAccountScopes_.getUnmodifiableView();
      }
      if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
        tags_ = tags_.getUnmodifiableView();
      }
      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_GceClusterConfig_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapField internalGetMapField(int number) {
    switch (number) {
      case 5:
        return internalGetMetadata();
      default:
        throw new RuntimeException("Invalid map field number: " + number);
    }
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.dataproc.v1.ClustersProto
        .internal_static_google_cloud_dataproc_v1_GceClusterConfig_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.dataproc.v1.GceClusterConfig.class,
            com.google.cloud.dataproc.v1.GceClusterConfig.Builder.class);
  }

  private int bitField0_;
  public static final int ZONE_URI_FIELD_NUMBER = 1;
  private volatile java.lang.Object zoneUri_;
  /**
   *
   *
   * <pre>
   * Optional. The zone where the Compute Engine cluster will be located.
   * On a create request, it is required in the "global" region. If omitted
   * in a non-global Cloud Dataproc region, the service will pick a zone in the
   * corresponding Compute Engine region. On a get request, zone will
   * always be present.
   * A full URL, partial URI, or short name are valid. Examples:
   * * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]`
   * * `projects/[project_id]/zones/[zone]`
   * * `us-central1-f`
   * </pre>
   *
   * <code>string zone_uri = 1;</code>
   */
  public java.lang.String getZoneUri() {
    java.lang.Object ref = zoneUri_;
    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();
      zoneUri_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. The zone where the Compute Engine cluster will be located.
   * On a create request, it is required in the "global" region. If omitted
   * in a non-global Cloud Dataproc region, the service will pick a zone in the
   * corresponding Compute Engine region. On a get request, zone will
   * always be present.
   * A full URL, partial URI, or short name are valid. Examples:
   * * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]`
   * * `projects/[project_id]/zones/[zone]`
   * * `us-central1-f`
   * </pre>
   *
   * <code>string zone_uri = 1;</code>
   */
  public com.google.protobuf.ByteString getZoneUriBytes() {
    java.lang.Object ref = zoneUri_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      zoneUri_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int NETWORK_URI_FIELD_NUMBER = 2;
  private volatile java.lang.Object networkUri_;
  /**
   *
   *
   * <pre>
   * Optional. The Compute Engine network to be used for machine
   * communications. Cannot be specified with subnetwork_uri. If neither
   * `network_uri` nor `subnetwork_uri` is specified, the "default" network of
   * the project is used, if it exists. Cannot be a "Custom Subnet Network" (see
   * [Using Subnetworks](/compute/docs/subnetworks) for more information).
   * A full URL, partial URI, or short name are valid. Examples:
   * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default`
   * * `projects/[project_id]/regions/global/default`
   * * `default`
   * </pre>
   *
   * <code>string network_uri = 2;</code>
   */
  public java.lang.String getNetworkUri() {
    java.lang.Object ref = networkUri_;
    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();
      networkUri_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. The Compute Engine network to be used for machine
   * communications. Cannot be specified with subnetwork_uri. If neither
   * `network_uri` nor `subnetwork_uri` is specified, the "default" network of
   * the project is used, if it exists. Cannot be a "Custom Subnet Network" (see
   * [Using Subnetworks](/compute/docs/subnetworks) for more information).
   * A full URL, partial URI, or short name are valid. Examples:
   * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default`
   * * `projects/[project_id]/regions/global/default`
   * * `default`
   * </pre>
   *
   * <code>string network_uri = 2;</code>
   */
  public com.google.protobuf.ByteString getNetworkUriBytes() {
    java.lang.Object ref = networkUri_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      networkUri_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SUBNETWORK_URI_FIELD_NUMBER = 6;
  private volatile java.lang.Object subnetworkUri_;
  /**
   *
   *
   * <pre>
   * Optional. The Compute Engine subnetwork to be used for machine
   * communications. Cannot be specified with network_uri.
   * A full URL, partial URI, or short name are valid. Examples:
   * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0`
   * * `projects/[project_id]/regions/us-east1/sub0`
   * * `sub0`
   * </pre>
   *
   * <code>string subnetwork_uri = 6;</code>
   */
  public java.lang.String getSubnetworkUri() {
    java.lang.Object ref = subnetworkUri_;
    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();
      subnetworkUri_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. The Compute Engine subnetwork to be used for machine
   * communications. Cannot be specified with network_uri.
   * A full URL, partial URI, or short name are valid. Examples:
   * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0`
   * * `projects/[project_id]/regions/us-east1/sub0`
   * * `sub0`
   * </pre>
   *
   * <code>string subnetwork_uri = 6;</code>
   */
  public com.google.protobuf.ByteString getSubnetworkUriBytes() {
    java.lang.Object ref = subnetworkUri_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      subnetworkUri_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int INTERNAL_IP_ONLY_FIELD_NUMBER = 7;
  private boolean internalIpOnly_;
  /**
   *
   *
   * <pre>
   * Optional. If true, all instances in the cluster will only have internal IP
   * addresses. By default, clusters are not restricted to internal IP addresses,
   * and will have ephemeral external IP addresses assigned to each instance.
   * This `internal_ip_only` restriction can only be enabled for subnetwork
   * enabled networks, and all off-cluster dependencies must be configured to be
   * accessible without external IP addresses.
   * </pre>
   *
   * <code>bool internal_ip_only = 7;</code>
   */
  public boolean getInternalIpOnly() {
    return internalIpOnly_;
  }

  public static final int SERVICE_ACCOUNT_FIELD_NUMBER = 8;
  private volatile java.lang.Object serviceAccount_;
  /**
   *
   *
   * <pre>
   * Optional. The service account of the instances. Defaults to the default
   * Compute Engine service account. Custom service accounts need
   * permissions equivalent to the following IAM roles:
   * * roles/logging.logWriter
   * * roles/storage.objectAdmin
   * (see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts
   * for more information).
   * Example: `[account_id]&#64;[project_id].iam.gserviceaccount.com`
   * </pre>
   *
   * <code>string service_account = 8;</code>
   */
  public java.lang.String getServiceAccount() {
    java.lang.Object ref = serviceAccount_;
    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();
      serviceAccount_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Optional. The service account of the instances. Defaults to the default
   * Compute Engine service account. Custom service accounts need
   * permissions equivalent to the following IAM roles:
   * * roles/logging.logWriter
   * * roles/storage.objectAdmin
   * (see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts
   * for more information).
   * Example: `[account_id]&#64;[project_id].iam.gserviceaccount.com`
   * </pre>
   *
   * <code>string service_account = 8;</code>
   */
  public com.google.protobuf.ByteString getServiceAccountBytes() {
    java.lang.Object ref = serviceAccount_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      serviceAccount_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SERVICE_ACCOUNT_SCOPES_FIELD_NUMBER = 3;
  private com.google.protobuf.LazyStringList serviceAccountScopes_;
  /**
   *
   *
   * <pre>
   * Optional. The URIs of service account scopes to be included in
   * Compute Engine instances. The following base set of scopes is always
   * included:
   * * https://www.googleapis.com/auth/cloud.useraccounts.readonly
   * * https://www.googleapis.com/auth/devstorage.read_write
   * * https://www.googleapis.com/auth/logging.write
   * If no scopes are specified, the following defaults are also provided:
   * * https://www.googleapis.com/auth/bigquery
   * * https://www.googleapis.com/auth/bigtable.admin.table
   * * https://www.googleapis.com/auth/bigtable.data
   * * https://www.googleapis.com/auth/devstorage.full_control
   * </pre>
   *
   * <code>repeated string service_account_scopes = 3;</code>
   */
  public com.google.protobuf.ProtocolStringList getServiceAccountScopesList() {
    return serviceAccountScopes_;
  }
  /**
   *
   *
   * <pre>
   * Optional. The URIs of service account scopes to be included in
   * Compute Engine instances. The following base set of scopes is always
   * included:
   * * https://www.googleapis.com/auth/cloud.useraccounts.readonly
   * * https://www.googleapis.com/auth/devstorage.read_write
   * * https://www.googleapis.com/auth/logging.write
   * If no scopes are specified, the following defaults are also provided:
   * * https://www.googleapis.com/auth/bigquery
   * * https://www.googleapis.com/auth/bigtable.admin.table
   * * https://www.googleapis.com/auth/bigtable.data
   * * https://www.googleapis.com/auth/devstorage.full_control
   * </pre>
   *
   * <code>repeated string service_account_scopes = 3;</code>
   */
  public int getServiceAccountScopesCount() {
    return serviceAccountScopes_.size();
  }
  /**
   *
   *
   * <pre>
   * Optional. The URIs of service account scopes to be included in
   * Compute Engine instances. The following base set of scopes is always
   * included:
   * * https://www.googleapis.com/auth/cloud.useraccounts.readonly
   * * https://www.googleapis.com/auth/devstorage.read_write
   * * https://www.googleapis.com/auth/logging.write
   * If no scopes are specified, the following defaults are also provided:
   * * https://www.googleapis.com/auth/bigquery
   * * https://www.googleapis.com/auth/bigtable.admin.table
   * * https://www.googleapis.com/auth/bigtable.data
   * * https://www.googleapis.com/auth/devstorage.full_control
   * </pre>
   *
   * <code>repeated string service_account_scopes = 3;</code>
   */
  public java.lang.String getServiceAccountScopes(int index) {
    return serviceAccountScopes_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Optional. The URIs of service account scopes to be included in
   * Compute Engine instances. The following base set of scopes is always
   * included:
   * * https://www.googleapis.com/auth/cloud.useraccounts.readonly
   * * https://www.googleapis.com/auth/devstorage.read_write
   * * https://www.googleapis.com/auth/logging.write
   * If no scopes are specified, the following defaults are also provided:
   * * https://www.googleapis.com/auth/bigquery
   * * https://www.googleapis.com/auth/bigtable.admin.table
   * * https://www.googleapis.com/auth/bigtable.data
   * * https://www.googleapis.com/auth/devstorage.full_control
   * </pre>
   *
   * <code>repeated string service_account_scopes = 3;</code>
   */
  public com.google.protobuf.ByteString getServiceAccountScopesBytes(int index) {
    return serviceAccountScopes_.getByteString(index);
  }

  public static final int TAGS_FIELD_NUMBER = 4;
  private com.google.protobuf.LazyStringList tags_;
  /**
   *
   *
   * <pre>
   * The Compute Engine tags to add to all instances (see
   * [Tagging instances](/compute/docs/label-or-tag-resources#tags)).
   * </pre>
   *
   * <code>repeated string tags = 4;</code>
   */
  public com.google.protobuf.ProtocolStringList getTagsList() {
    return tags_;
  }
  /**
   *
   *
   * <pre>
   * The Compute Engine tags to add to all instances (see
   * [Tagging instances](/compute/docs/label-or-tag-resources#tags)).
   * </pre>
   *
   * <code>repeated string tags = 4;</code>
   */
  public int getTagsCount() {
    return tags_.size();
  }
  /**
   *
   *
   * <pre>
   * The Compute Engine tags to add to all instances (see
   * [Tagging instances](/compute/docs/label-or-tag-resources#tags)).
   * </pre>
   *
   * <code>repeated string tags = 4;</code>
   */
  public java.lang.String getTags(int index) {
    return tags_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The Compute Engine tags to add to all instances (see
   * [Tagging instances](/compute/docs/label-or-tag-resources#tags)).
   * </pre>
   *
   * <code>repeated string tags = 4;</code>
   */
  public com.google.protobuf.ByteString getTagsBytes(int index) {
    return tags_.getByteString(index);
  }

  public static final int METADATA_FIELD_NUMBER = 5;

  private static final class MetadataDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry =
        com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(
            com.google.cloud.dataproc.v1.ClustersProto
                .internal_static_google_cloud_dataproc_v1_GceClusterConfig_MetadataEntry_descriptor,
            com.google.protobuf.WireFormat.FieldType.STRING,
            "",
            com.google.protobuf.WireFormat.FieldType.STRING,
            "");
  }

  private com.google.protobuf.MapField<java.lang.String, java.lang.String> metadata_;

  private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMetadata() {
    if (metadata_ == null) {
      return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry);
    }
    return metadata_;
  }

  public int getMetadataCount() {
    return internalGetMetadata().getMap().size();
  }
  /**
   *
   *
   * <pre>
   * The Compute Engine metadata entries to add to all instances (see
   * [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 5;</code>
   */
  public boolean containsMetadata(java.lang.String key) {
    if (key == null) {
      throw new java.lang.NullPointerException();
    }
    return internalGetMetadata().getMap().containsKey(key);
  }
  /** Use {@link #getMetadataMap()} instead. */
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getMetadata() {
    return getMetadataMap();
  }
  /**
   *
   *
   * <pre>
   * The Compute Engine metadata entries to add to all instances (see
   * [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 5;</code>
   */
  public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {
    return internalGetMetadata().getMap();
  }
  /**
   *
   *
   * <pre>
   * The Compute Engine metadata entries to add to all instances (see
   * [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 5;</code>
   */
  public java.lang.String getMetadataOrDefault(
      java.lang.String key, java.lang.String defaultValue) {
    if (key == null) {
      throw new java.lang.NullPointerException();
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   *
   *
   * <pre>
   * The Compute Engine metadata entries to add to all instances (see
   * [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
   * </pre>
   *
   * <code>map&lt;string, string&gt; metadata = 5;</code>
   */
  public java.lang.String getMetadataOrThrow(java.lang.String key) {
    if (key == null) {
      throw new java.lang.NullPointerException();
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  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 (!getZoneUriBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, zoneUri_);
    }
    if (!getNetworkUriBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, networkUri_);
    }
    for (int i = 0; i < serviceAccountScopes_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(
          output, 3, serviceAccountScopes_.getRaw(i));
    }
    for (int i = 0; i < tags_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, tags_.getRaw(i));
    }
    com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 5);
    if (!getSubnetworkUriBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, subnetworkUri_);
    }
    if (internalIpOnly_ != false) {
      output.writeBool(7, internalIpOnly_);
    }
    if (!getServiceAccountBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 8, serviceAccount_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getZoneUriBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, zoneUri_);
    }
    if (!getNetworkUriBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, networkUri_);
    }
    {
      int dataSize = 0;
      for (int i = 0; i < serviceAccountScopes_.size(); i++) {
        dataSize += computeStringSizeNoTag(serviceAccountScopes_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getServiceAccountScopesList().size();
    }
    {
      int dataSize = 0;
      for (int i = 0; i < tags_.size(); i++) {
        dataSize += computeStringSizeNoTag(tags_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getTagsList().size();
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
        internalGetMetadata().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String> metadata__ =
          MetadataDefaultEntryHolder.defaultEntry
              .newBuilderForType()
              .setKey(entry.getKey())
              .setValue(entry.getValue())
              .build();
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, metadata__);
    }
    if (!getSubnetworkUriBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, subnetworkUri_);
    }
    if (internalIpOnly_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, internalIpOnly_);
    }
    if (!getServiceAccountBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, serviceAccount_);
    }
    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.GceClusterConfig)) {
      return super.equals(obj);
    }
    com.google.cloud.dataproc.v1.GceClusterConfig other =
        (com.google.cloud.dataproc.v1.GceClusterConfig) obj;

    boolean result = true;
    result = result && getZoneUri().equals(other.getZoneUri());
    result = result && getNetworkUri().equals(other.getNetworkUri());
    result = result && getSubnetworkUri().equals(other.getSubnetworkUri());
    result = result && (getInternalIpOnly() == other.getInternalIpOnly());
    result = result && getServiceAccount().equals(other.getServiceAccount());
    result = result && getServiceAccountScopesList().equals(other.getServiceAccountScopesList());
    result = result && getTagsList().equals(other.getTagsList());
    result = result && internalGetMetadata().equals(other.internalGetMetadata());
    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) + ZONE_URI_FIELD_NUMBER;
    hash = (53 * hash) + getZoneUri().hashCode();
    hash = (37 * hash) + NETWORK_URI_FIELD_NUMBER;
    hash = (53 * hash) + getNetworkUri().hashCode();
    hash = (37 * hash) + SUBNETWORK_URI_FIELD_NUMBER;
    hash = (53 * hash) + getSubnetworkUri().hashCode();
    hash = (37 * hash) + INTERNAL_IP_ONLY_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInternalIpOnly());
    hash = (37 * hash) + SERVICE_ACCOUNT_FIELD_NUMBER;
    hash = (53 * hash) + getServiceAccount().hashCode();
    if (getServiceAccountScopesCount() > 0) {
      hash = (37 * hash) + SERVICE_ACCOUNT_SCOPES_FIELD_NUMBER;
      hash = (53 * hash) + getServiceAccountScopesList().hashCode();
    }
    if (getTagsCount() > 0) {
      hash = (37 * hash) + TAGS_FIELD_NUMBER;
      hash = (53 * hash) + getTagsList().hashCode();
    }
    if (!internalGetMetadata().getMap().isEmpty()) {
      hash = (37 * hash) + METADATA_FIELD_NUMBER;
      hash = (53 * hash) + internalGetMetadata().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

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

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.cloud.dataproc.v1.GceClusterConfig 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>
   * Common config settings for resources of Compute Engine cluster
   * instances, applicable to all instances in the cluster.
   * </pre>
   *
   * Protobuf type {@code google.cloud.dataproc.v1.GceClusterConfig}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.dataproc.v1.GceClusterConfig)
      com.google.cloud.dataproc.v1.GceClusterConfigOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.dataproc.v1.ClustersProto
          .internal_static_google_cloud_dataproc_v1_GceClusterConfig_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(int number) {
      switch (number) {
        case 5:
          return internalGetMetadata();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
      switch (number) {
        case 5:
          return internalGetMutableMetadata();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.dataproc.v1.ClustersProto
          .internal_static_google_cloud_dataproc_v1_GceClusterConfig_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.dataproc.v1.GceClusterConfig.class,
              com.google.cloud.dataproc.v1.GceClusterConfig.Builder.class);
    }

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

      networkUri_ = "";

      subnetworkUri_ = "";

      internalIpOnly_ = false;

      serviceAccount_ = "";

      serviceAccountScopes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000020);
      tags_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000040);
      internalGetMutableMetadata().clear();
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.dataproc.v1.ClustersProto
          .internal_static_google_cloud_dataproc_v1_GceClusterConfig_descriptor;
    }

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

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

    @java.lang.Override
    public com.google.cloud.dataproc.v1.GceClusterConfig buildPartial() {
      com.google.cloud.dataproc.v1.GceClusterConfig result =
          new com.google.cloud.dataproc.v1.GceClusterConfig(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.zoneUri_ = zoneUri_;
      result.networkUri_ = networkUri_;
      result.subnetworkUri_ = subnetworkUri_;
      result.internalIpOnly_ = internalIpOnly_;
      result.serviceAccount_ = serviceAccount_;
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        serviceAccountScopes_ = serviceAccountScopes_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000020);
      }
      result.serviceAccountScopes_ = serviceAccountScopes_;
      if (((bitField0_ & 0x00000040) == 0x00000040)) {
        tags_ = tags_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000040);
      }
      result.tags_ = tags_;
      result.metadata_ = internalGetMetadata();
      result.metadata_.makeImmutable();
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return (Builder) super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return (Builder) super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.dataproc.v1.GceClusterConfig) {
        return mergeFrom((com.google.cloud.dataproc.v1.GceClusterConfig) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.dataproc.v1.GceClusterConfig other) {
      if (other == com.google.cloud.dataproc.v1.GceClusterConfig.getDefaultInstance()) return this;
      if (!other.getZoneUri().isEmpty()) {
        zoneUri_ = other.zoneUri_;
        onChanged();
      }
      if (!other.getNetworkUri().isEmpty()) {
        networkUri_ = other.networkUri_;
        onChanged();
      }
      if (!other.getSubnetworkUri().isEmpty()) {
        subnetworkUri_ = other.subnetworkUri_;
        onChanged();
      }
      if (other.getInternalIpOnly() != false) {
        setInternalIpOnly(other.getInternalIpOnly());
      }
      if (!other.getServiceAccount().isEmpty()) {
        serviceAccount_ = other.serviceAccount_;
        onChanged();
      }
      if (!other.serviceAccountScopes_.isEmpty()) {
        if (serviceAccountScopes_.isEmpty()) {
          serviceAccountScopes_ = other.serviceAccountScopes_;
          bitField0_ = (bitField0_ & ~0x00000020);
        } else {
          ensureServiceAccountScopesIsMutable();
          serviceAccountScopes_.addAll(other.serviceAccountScopes_);
        }
        onChanged();
      }
      if (!other.tags_.isEmpty()) {
        if (tags_.isEmpty()) {
          tags_ = other.tags_;
          bitField0_ = (bitField0_ & ~0x00000040);
        } else {
          ensureTagsIsMutable();
          tags_.addAll(other.tags_);
        }
        onChanged();
      }
      internalGetMutableMetadata().mergeFrom(other.internalGetMetadata());
      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.cloud.dataproc.v1.GceClusterConfig parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.dataproc.v1.GceClusterConfig) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private java.lang.Object zoneUri_ = "";
    /**
     *
     *
     * <pre>
     * Optional. The zone where the Compute Engine cluster will be located.
     * On a create request, it is required in the "global" region. If omitted
     * in a non-global Cloud Dataproc region, the service will pick a zone in the
     * corresponding Compute Engine region. On a get request, zone will
     * always be present.
     * A full URL, partial URI, or short name are valid. Examples:
     * * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]`
     * * `projects/[project_id]/zones/[zone]`
     * * `us-central1-f`
     * </pre>
     *
     * <code>string zone_uri = 1;</code>
     */
    public java.lang.String getZoneUri() {
      java.lang.Object ref = zoneUri_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        zoneUri_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The zone where the Compute Engine cluster will be located.
     * On a create request, it is required in the "global" region. If omitted
     * in a non-global Cloud Dataproc region, the service will pick a zone in the
     * corresponding Compute Engine region. On a get request, zone will
     * always be present.
     * A full URL, partial URI, or short name are valid. Examples:
     * * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]`
     * * `projects/[project_id]/zones/[zone]`
     * * `us-central1-f`
     * </pre>
     *
     * <code>string zone_uri = 1;</code>
     */
    public com.google.protobuf.ByteString getZoneUriBytes() {
      java.lang.Object ref = zoneUri_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        zoneUri_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The zone where the Compute Engine cluster will be located.
     * On a create request, it is required in the "global" region. If omitted
     * in a non-global Cloud Dataproc region, the service will pick a zone in the
     * corresponding Compute Engine region. On a get request, zone will
     * always be present.
     * A full URL, partial URI, or short name are valid. Examples:
     * * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]`
     * * `projects/[project_id]/zones/[zone]`
     * * `us-central1-f`
     * </pre>
     *
     * <code>string zone_uri = 1;</code>
     */
    public Builder setZoneUri(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      zoneUri_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The zone where the Compute Engine cluster will be located.
     * On a create request, it is required in the "global" region. If omitted
     * in a non-global Cloud Dataproc region, the service will pick a zone in the
     * corresponding Compute Engine region. On a get request, zone will
     * always be present.
     * A full URL, partial URI, or short name are valid. Examples:
     * * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]`
     * * `projects/[project_id]/zones/[zone]`
     * * `us-central1-f`
     * </pre>
     *
     * <code>string zone_uri = 1;</code>
     */
    public Builder clearZoneUri() {

      zoneUri_ = getDefaultInstance().getZoneUri();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The zone where the Compute Engine cluster will be located.
     * On a create request, it is required in the "global" region. If omitted
     * in a non-global Cloud Dataproc region, the service will pick a zone in the
     * corresponding Compute Engine region. On a get request, zone will
     * always be present.
     * A full URL, partial URI, or short name are valid. Examples:
     * * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]`
     * * `projects/[project_id]/zones/[zone]`
     * * `us-central1-f`
     * </pre>
     *
     * <code>string zone_uri = 1;</code>
     */
    public Builder setZoneUriBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private java.lang.Object networkUri_ = "";
    /**
     *
     *
     * <pre>
     * Optional. The Compute Engine network to be used for machine
     * communications. Cannot be specified with subnetwork_uri. If neither
     * `network_uri` nor `subnetwork_uri` is specified, the "default" network of
     * the project is used, if it exists. Cannot be a "Custom Subnet Network" (see
     * [Using Subnetworks](/compute/docs/subnetworks) for more information).
     * A full URL, partial URI, or short name are valid. Examples:
     * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default`
     * * `projects/[project_id]/regions/global/default`
     * * `default`
     * </pre>
     *
     * <code>string network_uri = 2;</code>
     */
    public java.lang.String getNetworkUri() {
      java.lang.Object ref = networkUri_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        networkUri_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The Compute Engine network to be used for machine
     * communications. Cannot be specified with subnetwork_uri. If neither
     * `network_uri` nor `subnetwork_uri` is specified, the "default" network of
     * the project is used, if it exists. Cannot be a "Custom Subnet Network" (see
     * [Using Subnetworks](/compute/docs/subnetworks) for more information).
     * A full URL, partial URI, or short name are valid. Examples:
     * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default`
     * * `projects/[project_id]/regions/global/default`
     * * `default`
     * </pre>
     *
     * <code>string network_uri = 2;</code>
     */
    public com.google.protobuf.ByteString getNetworkUriBytes() {
      java.lang.Object ref = networkUri_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        networkUri_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The Compute Engine network to be used for machine
     * communications. Cannot be specified with subnetwork_uri. If neither
     * `network_uri` nor `subnetwork_uri` is specified, the "default" network of
     * the project is used, if it exists. Cannot be a "Custom Subnet Network" (see
     * [Using Subnetworks](/compute/docs/subnetworks) for more information).
     * A full URL, partial URI, or short name are valid. Examples:
     * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default`
     * * `projects/[project_id]/regions/global/default`
     * * `default`
     * </pre>
     *
     * <code>string network_uri = 2;</code>
     */
    public Builder setNetworkUri(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      networkUri_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The Compute Engine network to be used for machine
     * communications. Cannot be specified with subnetwork_uri. If neither
     * `network_uri` nor `subnetwork_uri` is specified, the "default" network of
     * the project is used, if it exists. Cannot be a "Custom Subnet Network" (see
     * [Using Subnetworks](/compute/docs/subnetworks) for more information).
     * A full URL, partial URI, or short name are valid. Examples:
     * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default`
     * * `projects/[project_id]/regions/global/default`
     * * `default`
     * </pre>
     *
     * <code>string network_uri = 2;</code>
     */
    public Builder clearNetworkUri() {

      networkUri_ = getDefaultInstance().getNetworkUri();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The Compute Engine network to be used for machine
     * communications. Cannot be specified with subnetwork_uri. If neither
     * `network_uri` nor `subnetwork_uri` is specified, the "default" network of
     * the project is used, if it exists. Cannot be a "Custom Subnet Network" (see
     * [Using Subnetworks](/compute/docs/subnetworks) for more information).
     * A full URL, partial URI, or short name are valid. Examples:
     * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default`
     * * `projects/[project_id]/regions/global/default`
     * * `default`
     * </pre>
     *
     * <code>string network_uri = 2;</code>
     */
    public Builder setNetworkUriBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private java.lang.Object subnetworkUri_ = "";
    /**
     *
     *
     * <pre>
     * Optional. The Compute Engine subnetwork to be used for machine
     * communications. Cannot be specified with network_uri.
     * A full URL, partial URI, or short name are valid. Examples:
     * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0`
     * * `projects/[project_id]/regions/us-east1/sub0`
     * * `sub0`
     * </pre>
     *
     * <code>string subnetwork_uri = 6;</code>
     */
    public java.lang.String getSubnetworkUri() {
      java.lang.Object ref = subnetworkUri_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        subnetworkUri_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The Compute Engine subnetwork to be used for machine
     * communications. Cannot be specified with network_uri.
     * A full URL, partial URI, or short name are valid. Examples:
     * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0`
     * * `projects/[project_id]/regions/us-east1/sub0`
     * * `sub0`
     * </pre>
     *
     * <code>string subnetwork_uri = 6;</code>
     */
    public com.google.protobuf.ByteString getSubnetworkUriBytes() {
      java.lang.Object ref = subnetworkUri_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        subnetworkUri_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The Compute Engine subnetwork to be used for machine
     * communications. Cannot be specified with network_uri.
     * A full URL, partial URI, or short name are valid. Examples:
     * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0`
     * * `projects/[project_id]/regions/us-east1/sub0`
     * * `sub0`
     * </pre>
     *
     * <code>string subnetwork_uri = 6;</code>
     */
    public Builder setSubnetworkUri(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      subnetworkUri_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The Compute Engine subnetwork to be used for machine
     * communications. Cannot be specified with network_uri.
     * A full URL, partial URI, or short name are valid. Examples:
     * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0`
     * * `projects/[project_id]/regions/us-east1/sub0`
     * * `sub0`
     * </pre>
     *
     * <code>string subnetwork_uri = 6;</code>
     */
    public Builder clearSubnetworkUri() {

      subnetworkUri_ = getDefaultInstance().getSubnetworkUri();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The Compute Engine subnetwork to be used for machine
     * communications. Cannot be specified with network_uri.
     * A full URL, partial URI, or short name are valid. Examples:
     * * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0`
     * * `projects/[project_id]/regions/us-east1/sub0`
     * * `sub0`
     * </pre>
     *
     * <code>string subnetwork_uri = 6;</code>
     */
    public Builder setSubnetworkUriBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private boolean internalIpOnly_;
    /**
     *
     *
     * <pre>
     * Optional. If true, all instances in the cluster will only have internal IP
     * addresses. By default, clusters are not restricted to internal IP addresses,
     * and will have ephemeral external IP addresses assigned to each instance.
     * This `internal_ip_only` restriction can only be enabled for subnetwork
     * enabled networks, and all off-cluster dependencies must be configured to be
     * accessible without external IP addresses.
     * </pre>
     *
     * <code>bool internal_ip_only = 7;</code>
     */
    public boolean getInternalIpOnly() {
      return internalIpOnly_;
    }
    /**
     *
     *
     * <pre>
     * Optional. If true, all instances in the cluster will only have internal IP
     * addresses. By default, clusters are not restricted to internal IP addresses,
     * and will have ephemeral external IP addresses assigned to each instance.
     * This `internal_ip_only` restriction can only be enabled for subnetwork
     * enabled networks, and all off-cluster dependencies must be configured to be
     * accessible without external IP addresses.
     * </pre>
     *
     * <code>bool internal_ip_only = 7;</code>
     */
    public Builder setInternalIpOnly(boolean value) {

      internalIpOnly_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. If true, all instances in the cluster will only have internal IP
     * addresses. By default, clusters are not restricted to internal IP addresses,
     * and will have ephemeral external IP addresses assigned to each instance.
     * This `internal_ip_only` restriction can only be enabled for subnetwork
     * enabled networks, and all off-cluster dependencies must be configured to be
     * accessible without external IP addresses.
     * </pre>
     *
     * <code>bool internal_ip_only = 7;</code>
     */
    public Builder clearInternalIpOnly() {

      internalIpOnly_ = false;
      onChanged();
      return this;
    }

    private java.lang.Object serviceAccount_ = "";
    /**
     *
     *
     * <pre>
     * Optional. The service account of the instances. Defaults to the default
     * Compute Engine service account. Custom service accounts need
     * permissions equivalent to the following IAM roles:
     * * roles/logging.logWriter
     * * roles/storage.objectAdmin
     * (see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts
     * for more information).
     * Example: `[account_id]&#64;[project_id].iam.gserviceaccount.com`
     * </pre>
     *
     * <code>string service_account = 8;</code>
     */
    public java.lang.String getServiceAccount() {
      java.lang.Object ref = serviceAccount_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        serviceAccount_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The service account of the instances. Defaults to the default
     * Compute Engine service account. Custom service accounts need
     * permissions equivalent to the following IAM roles:
     * * roles/logging.logWriter
     * * roles/storage.objectAdmin
     * (see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts
     * for more information).
     * Example: `[account_id]&#64;[project_id].iam.gserviceaccount.com`
     * </pre>
     *
     * <code>string service_account = 8;</code>
     */
    public com.google.protobuf.ByteString getServiceAccountBytes() {
      java.lang.Object ref = serviceAccount_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        serviceAccount_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The service account of the instances. Defaults to the default
     * Compute Engine service account. Custom service accounts need
     * permissions equivalent to the following IAM roles:
     * * roles/logging.logWriter
     * * roles/storage.objectAdmin
     * (see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts
     * for more information).
     * Example: `[account_id]&#64;[project_id].iam.gserviceaccount.com`
     * </pre>
     *
     * <code>string service_account = 8;</code>
     */
    public Builder setServiceAccount(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      serviceAccount_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The service account of the instances. Defaults to the default
     * Compute Engine service account. Custom service accounts need
     * permissions equivalent to the following IAM roles:
     * * roles/logging.logWriter
     * * roles/storage.objectAdmin
     * (see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts
     * for more information).
     * Example: `[account_id]&#64;[project_id].iam.gserviceaccount.com`
     * </pre>
     *
     * <code>string service_account = 8;</code>
     */
    public Builder clearServiceAccount() {

      serviceAccount_ = getDefaultInstance().getServiceAccount();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The service account of the instances. Defaults to the default
     * Compute Engine service account. Custom service accounts need
     * permissions equivalent to the following IAM roles:
     * * roles/logging.logWriter
     * * roles/storage.objectAdmin
     * (see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts
     * for more information).
     * Example: `[account_id]&#64;[project_id].iam.gserviceaccount.com`
     * </pre>
     *
     * <code>string service_account = 8;</code>
     */
    public Builder setServiceAccountBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

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

    private void ensureServiceAccountScopesIsMutable() {
      if (!((bitField0_ & 0x00000020) == 0x00000020)) {
        serviceAccountScopes_ = new com.google.protobuf.LazyStringArrayList(serviceAccountScopes_);
        bitField0_ |= 0x00000020;
      }
    }
    /**
     *
     *
     * <pre>
     * Optional. The URIs of service account scopes to be included in
     * Compute Engine instances. The following base set of scopes is always
     * included:
     * * https://www.googleapis.com/auth/cloud.useraccounts.readonly
     * * https://www.googleapis.com/auth/devstorage.read_write
     * * https://www.googleapis.com/auth/logging.write
     * If no scopes are specified, the following defaults are also provided:
     * * https://www.googleapis.com/auth/bigquery
     * * https://www.googleapis.com/auth/bigtable.admin.table
     * * https://www.googleapis.com/auth/bigtable.data
     * * https://www.googleapis.com/auth/devstorage.full_control
     * </pre>
     *
     * <code>repeated string service_account_scopes = 3;</code>
     */
    public com.google.protobuf.ProtocolStringList getServiceAccountScopesList() {
      return serviceAccountScopes_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * Optional. The URIs of service account scopes to be included in
     * Compute Engine instances. The following base set of scopes is always
     * included:
     * * https://www.googleapis.com/auth/cloud.useraccounts.readonly
     * * https://www.googleapis.com/auth/devstorage.read_write
     * * https://www.googleapis.com/auth/logging.write
     * If no scopes are specified, the following defaults are also provided:
     * * https://www.googleapis.com/auth/bigquery
     * * https://www.googleapis.com/auth/bigtable.admin.table
     * * https://www.googleapis.com/auth/bigtable.data
     * * https://www.googleapis.com/auth/devstorage.full_control
     * </pre>
     *
     * <code>repeated string service_account_scopes = 3;</code>
     */
    public int getServiceAccountScopesCount() {
      return serviceAccountScopes_.size();
    }
    /**
     *
     *
     * <pre>
     * Optional. The URIs of service account scopes to be included in
     * Compute Engine instances. The following base set of scopes is always
     * included:
     * * https://www.googleapis.com/auth/cloud.useraccounts.readonly
     * * https://www.googleapis.com/auth/devstorage.read_write
     * * https://www.googleapis.com/auth/logging.write
     * If no scopes are specified, the following defaults are also provided:
     * * https://www.googleapis.com/auth/bigquery
     * * https://www.googleapis.com/auth/bigtable.admin.table
     * * https://www.googleapis.com/auth/bigtable.data
     * * https://www.googleapis.com/auth/devstorage.full_control
     * </pre>
     *
     * <code>repeated string service_account_scopes = 3;</code>
     */
    public java.lang.String getServiceAccountScopes(int index) {
      return serviceAccountScopes_.get(index);
    }
    /**
     *
     *
     * <pre>
     * Optional. The URIs of service account scopes to be included in
     * Compute Engine instances. The following base set of scopes is always
     * included:
     * * https://www.googleapis.com/auth/cloud.useraccounts.readonly
     * * https://www.googleapis.com/auth/devstorage.read_write
     * * https://www.googleapis.com/auth/logging.write
     * If no scopes are specified, the following defaults are also provided:
     * * https://www.googleapis.com/auth/bigquery
     * * https://www.googleapis.com/auth/bigtable.admin.table
     * * https://www.googleapis.com/auth/bigtable.data
     * * https://www.googleapis.com/auth/devstorage.full_control
     * </pre>
     *
     * <code>repeated string service_account_scopes = 3;</code>
     */
    public com.google.protobuf.ByteString getServiceAccountScopesBytes(int index) {
      return serviceAccountScopes_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * Optional. The URIs of service account scopes to be included in
     * Compute Engine instances. The following base set of scopes is always
     * included:
     * * https://www.googleapis.com/auth/cloud.useraccounts.readonly
     * * https://www.googleapis.com/auth/devstorage.read_write
     * * https://www.googleapis.com/auth/logging.write
     * If no scopes are specified, the following defaults are also provided:
     * * https://www.googleapis.com/auth/bigquery
     * * https://www.googleapis.com/auth/bigtable.admin.table
     * * https://www.googleapis.com/auth/bigtable.data
     * * https://www.googleapis.com/auth/devstorage.full_control
     * </pre>
     *
     * <code>repeated string service_account_scopes = 3;</code>
     */
    public Builder setServiceAccountScopes(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureServiceAccountScopesIsMutable();
      serviceAccountScopes_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The URIs of service account scopes to be included in
     * Compute Engine instances. The following base set of scopes is always
     * included:
     * * https://www.googleapis.com/auth/cloud.useraccounts.readonly
     * * https://www.googleapis.com/auth/devstorage.read_write
     * * https://www.googleapis.com/auth/logging.write
     * If no scopes are specified, the following defaults are also provided:
     * * https://www.googleapis.com/auth/bigquery
     * * https://www.googleapis.com/auth/bigtable.admin.table
     * * https://www.googleapis.com/auth/bigtable.data
     * * https://www.googleapis.com/auth/devstorage.full_control
     * </pre>
     *
     * <code>repeated string service_account_scopes = 3;</code>
     */
    public Builder addServiceAccountScopes(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureServiceAccountScopesIsMutable();
      serviceAccountScopes_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The URIs of service account scopes to be included in
     * Compute Engine instances. The following base set of scopes is always
     * included:
     * * https://www.googleapis.com/auth/cloud.useraccounts.readonly
     * * https://www.googleapis.com/auth/devstorage.read_write
     * * https://www.googleapis.com/auth/logging.write
     * If no scopes are specified, the following defaults are also provided:
     * * https://www.googleapis.com/auth/bigquery
     * * https://www.googleapis.com/auth/bigtable.admin.table
     * * https://www.googleapis.com/auth/bigtable.data
     * * https://www.googleapis.com/auth/devstorage.full_control
     * </pre>
     *
     * <code>repeated string service_account_scopes = 3;</code>
     */
    public Builder addAllServiceAccountScopes(java.lang.Iterable<java.lang.String> values) {
      ensureServiceAccountScopesIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, serviceAccountScopes_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The URIs of service account scopes to be included in
     * Compute Engine instances. The following base set of scopes is always
     * included:
     * * https://www.googleapis.com/auth/cloud.useraccounts.readonly
     * * https://www.googleapis.com/auth/devstorage.read_write
     * * https://www.googleapis.com/auth/logging.write
     * If no scopes are specified, the following defaults are also provided:
     * * https://www.googleapis.com/auth/bigquery
     * * https://www.googleapis.com/auth/bigtable.admin.table
     * * https://www.googleapis.com/auth/bigtable.data
     * * https://www.googleapis.com/auth/devstorage.full_control
     * </pre>
     *
     * <code>repeated string service_account_scopes = 3;</code>
     */
    public Builder clearServiceAccountScopes() {
      serviceAccountScopes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000020);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Optional. The URIs of service account scopes to be included in
     * Compute Engine instances. The following base set of scopes is always
     * included:
     * * https://www.googleapis.com/auth/cloud.useraccounts.readonly
     * * https://www.googleapis.com/auth/devstorage.read_write
     * * https://www.googleapis.com/auth/logging.write
     * If no scopes are specified, the following defaults are also provided:
     * * https://www.googleapis.com/auth/bigquery
     * * https://www.googleapis.com/auth/bigtable.admin.table
     * * https://www.googleapis.com/auth/bigtable.data
     * * https://www.googleapis.com/auth/devstorage.full_control
     * </pre>
     *
     * <code>repeated string service_account_scopes = 3;</code>
     */
    public Builder addServiceAccountScopesBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureServiceAccountScopesIsMutable();
      serviceAccountScopes_.add(value);
      onChanged();
      return this;
    }

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

    private void ensureTagsIsMutable() {
      if (!((bitField0_ & 0x00000040) == 0x00000040)) {
        tags_ = new com.google.protobuf.LazyStringArrayList(tags_);
        bitField0_ |= 0x00000040;
      }
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine tags to add to all instances (see
     * [Tagging instances](/compute/docs/label-or-tag-resources#tags)).
     * </pre>
     *
     * <code>repeated string tags = 4;</code>
     */
    public com.google.protobuf.ProtocolStringList getTagsList() {
      return tags_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine tags to add to all instances (see
     * [Tagging instances](/compute/docs/label-or-tag-resources#tags)).
     * </pre>
     *
     * <code>repeated string tags = 4;</code>
     */
    public int getTagsCount() {
      return tags_.size();
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine tags to add to all instances (see
     * [Tagging instances](/compute/docs/label-or-tag-resources#tags)).
     * </pre>
     *
     * <code>repeated string tags = 4;</code>
     */
    public java.lang.String getTags(int index) {
      return tags_.get(index);
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine tags to add to all instances (see
     * [Tagging instances](/compute/docs/label-or-tag-resources#tags)).
     * </pre>
     *
     * <code>repeated string tags = 4;</code>
     */
    public com.google.protobuf.ByteString getTagsBytes(int index) {
      return tags_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine tags to add to all instances (see
     * [Tagging instances](/compute/docs/label-or-tag-resources#tags)).
     * </pre>
     *
     * <code>repeated string tags = 4;</code>
     */
    public Builder setTags(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureTagsIsMutable();
      tags_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine tags to add to all instances (see
     * [Tagging instances](/compute/docs/label-or-tag-resources#tags)).
     * </pre>
     *
     * <code>repeated string tags = 4;</code>
     */
    public Builder addTags(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureTagsIsMutable();
      tags_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine tags to add to all instances (see
     * [Tagging instances](/compute/docs/label-or-tag-resources#tags)).
     * </pre>
     *
     * <code>repeated string tags = 4;</code>
     */
    public Builder addAllTags(java.lang.Iterable<java.lang.String> values) {
      ensureTagsIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, tags_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine tags to add to all instances (see
     * [Tagging instances](/compute/docs/label-or-tag-resources#tags)).
     * </pre>
     *
     * <code>repeated string tags = 4;</code>
     */
    public Builder clearTags() {
      tags_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000040);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine tags to add to all instances (see
     * [Tagging instances](/compute/docs/label-or-tag-resources#tags)).
     * </pre>
     *
     * <code>repeated string tags = 4;</code>
     */
    public Builder addTagsBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureTagsIsMutable();
      tags_.add(value);
      onChanged();
      return this;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> metadata_;

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMetadata() {
      if (metadata_ == null) {
        return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry);
      }
      return metadata_;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetMutableMetadata() {
      onChanged();
      ;
      if (metadata_ == null) {
        metadata_ =
            com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry);
      }
      if (!metadata_.isMutable()) {
        metadata_ = metadata_.copy();
      }
      return metadata_;
    }

    public int getMetadataCount() {
      return internalGetMetadata().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine metadata entries to add to all instances (see
     * [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 5;</code>
     */
    public boolean containsMetadata(java.lang.String key) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      return internalGetMetadata().getMap().containsKey(key);
    }
    /** Use {@link #getMetadataMap()} instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getMetadata() {
      return getMetadataMap();
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine metadata entries to add to all instances (see
     * [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 5;</code>
     */
    public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {
      return internalGetMetadata().getMap();
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine metadata entries to add to all instances (see
     * [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 5;</code>
     */
    public java.lang.String getMetadataOrDefault(
        java.lang.String key, java.lang.String defaultValue) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine metadata entries to add to all instances (see
     * [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 5;</code>
     */
    public java.lang.String getMetadataOrThrow(java.lang.String key) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearMetadata() {
      internalGetMutableMetadata().getMutableMap().clear();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine metadata entries to add to all instances (see
     * [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 5;</code>
     */
    public Builder removeMetadata(java.lang.String key) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      internalGetMutableMetadata().getMutableMap().remove(key);
      return this;
    }
    /** Use alternate mutation accessors instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getMutableMetadata() {
      return internalGetMutableMetadata().getMutableMap();
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine metadata entries to add to all instances (see
     * [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 5;</code>
     */
    public Builder putMetadata(java.lang.String key, java.lang.String value) {
      if (key == null) {
        throw new java.lang.NullPointerException();
      }
      if (value == null) {
        throw new java.lang.NullPointerException();
      }
      internalGetMutableMetadata().getMutableMap().put(key, value);
      return this;
    }
    /**
     *
     *
     * <pre>
     * The Compute Engine metadata entries to add to all instances (see
     * [Project and instance metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
     * </pre>
     *
     * <code>map&lt;string, string&gt; metadata = 5;</code>
     */
    public Builder putAllMetadata(java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableMetadata().getMutableMap().putAll(values);
      return this;
    }

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

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

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

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

  static {
    DEFAULT_INSTANCE = new com.google.cloud.dataproc.v1.GceClusterConfig();
  }

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

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

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

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

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