/*
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/baremetalsolution/v2/instance.proto

package com.google.cloud.baremetalsolution.v2;

/**
 *
 *
 * <pre>
 * A server.
 * </pre>
 *
 * Protobuf type {@code google.cloud.baremetalsolution.v2.Instance}
 */
public final class Instance extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.baremetalsolution.v2.Instance)
    InstanceOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use Instance.newBuilder() to construct.
  private Instance(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private Instance() {
    name_ = "";
    id_ = "";
    machineType_ = "";
    state_ = 0;
    luns_ = java.util.Collections.emptyList();
    volumes_ = java.util.Collections.emptyList();
    networks_ = java.util.Collections.emptyList();
    osImage_ = "";
    pod_ = "";
    networkTemplate_ = "";
    logicalInterfaces_ = java.util.Collections.emptyList();
    loginInfo_ = "";
    workloadProfile_ = 0;
    firmwareVersion_ = "";
  }

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

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.baremetalsolution.v2.InstanceProto
        .internal_static_google_cloud_baremetalsolution_v2_Instance_descriptor;
  }

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

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.baremetalsolution.v2.InstanceProto
        .internal_static_google_cloud_baremetalsolution_v2_Instance_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.baremetalsolution.v2.Instance.class,
            com.google.cloud.baremetalsolution.v2.Instance.Builder.class);
  }

  /**
   *
   *
   * <pre>
   * The possible states for this server.
   * </pre>
   *
   * Protobuf enum {@code google.cloud.baremetalsolution.v2.Instance.State}
   */
  public enum State implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *
     *
     * <pre>
     * The server is in an unknown state.
     * </pre>
     *
     * <code>STATE_UNSPECIFIED = 0;</code>
     */
    STATE_UNSPECIFIED(0),
    /**
     *
     *
     * <pre>
     * The server is being provisioned.
     * </pre>
     *
     * <code>PROVISIONING = 1;</code>
     */
    PROVISIONING(1),
    /**
     *
     *
     * <pre>
     * The server is running.
     * </pre>
     *
     * <code>RUNNING = 2;</code>
     */
    RUNNING(2),
    /**
     *
     *
     * <pre>
     * The server has been deleted.
     * </pre>
     *
     * <code>DELETED = 3;</code>
     */
    DELETED(3),
    /**
     *
     *
     * <pre>
     * The server is being updated.
     * </pre>
     *
     * <code>UPDATING = 4;</code>
     */
    UPDATING(4),
    /**
     *
     *
     * <pre>
     * The server is starting.
     * </pre>
     *
     * <code>STARTING = 5;</code>
     */
    STARTING(5),
    /**
     *
     *
     * <pre>
     * The server is stopping.
     * </pre>
     *
     * <code>STOPPING = 6;</code>
     */
    STOPPING(6),
    /**
     *
     *
     * <pre>
     * The server is shutdown.
     * </pre>
     *
     * <code>SHUTDOWN = 7;</code>
     */
    SHUTDOWN(7),
    UNRECOGNIZED(-1),
    ;

    /**
     *
     *
     * <pre>
     * The server is in an unknown state.
     * </pre>
     *
     * <code>STATE_UNSPECIFIED = 0;</code>
     */
    public static final int STATE_UNSPECIFIED_VALUE = 0;
    /**
     *
     *
     * <pre>
     * The server is being provisioned.
     * </pre>
     *
     * <code>PROVISIONING = 1;</code>
     */
    public static final int PROVISIONING_VALUE = 1;
    /**
     *
     *
     * <pre>
     * The server is running.
     * </pre>
     *
     * <code>RUNNING = 2;</code>
     */
    public static final int RUNNING_VALUE = 2;
    /**
     *
     *
     * <pre>
     * The server has been deleted.
     * </pre>
     *
     * <code>DELETED = 3;</code>
     */
    public static final int DELETED_VALUE = 3;
    /**
     *
     *
     * <pre>
     * The server is being updated.
     * </pre>
     *
     * <code>UPDATING = 4;</code>
     */
    public static final int UPDATING_VALUE = 4;
    /**
     *
     *
     * <pre>
     * The server is starting.
     * </pre>
     *
     * <code>STARTING = 5;</code>
     */
    public static final int STARTING_VALUE = 5;
    /**
     *
     *
     * <pre>
     * The server is stopping.
     * </pre>
     *
     * <code>STOPPING = 6;</code>
     */
    public static final int STOPPING_VALUE = 6;
    /**
     *
     *
     * <pre>
     * The server is shutdown.
     * </pre>
     *
     * <code>SHUTDOWN = 7;</code>
     */
    public static final int SHUTDOWN_VALUE = 7;

    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static State valueOf(int value) {
      return forNumber(value);
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     */
    public static State forNumber(int value) {
      switch (value) {
        case 0:
          return STATE_UNSPECIFIED;
        case 1:
          return PROVISIONING;
        case 2:
          return RUNNING;
        case 3:
          return DELETED;
        case 4:
          return UPDATING;
        case 5:
          return STARTING;
        case 6:
          return STOPPING;
        case 7:
          return SHUTDOWN;
        default:
          return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<State> internalGetValueMap() {
      return internalValueMap;
    }

    private static final com.google.protobuf.Internal.EnumLiteMap<State> internalValueMap =
        new com.google.protobuf.Internal.EnumLiteMap<State>() {
          public State findValueByNumber(int number) {
            return State.forNumber(number);
          }
        };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalStateException(
            "Can't get the descriptor of an unrecognized enum value.");
      }
      return getDescriptor().getValues().get(ordinal());
    }

    public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
      return getDescriptor();
    }

    public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
      return com.google.cloud.baremetalsolution.v2.Instance.getDescriptor().getEnumTypes().get(0);
    }

    private static final State[] VALUES = values();

    public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
      }
      if (desc.getIndex() == -1) {
        return UNRECOGNIZED;
      }
      return VALUES[desc.getIndex()];
    }

    private final int value;

    private State(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.cloud.baremetalsolution.v2.Instance.State)
  }

  public static final int NAME_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object name_ = "";
  /**
   *
   *
   * <pre>
   * Immutable. The resource name of this `Instance`.
   * Resource names are schemeless URIs that follow the conventions in
   * https://cloud.google.com/apis/design/resource_names.
   * Format:
   * `projects/{project}/locations/{location}/instances/{instance}`
   * </pre>
   *
   * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
   *
   * @return The name.
   */
  @java.lang.Override
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    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();
      name_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Immutable. The resource name of this `Instance`.
   * Resource names are schemeless URIs that follow the conventions in
   * https://cloud.google.com/apis/design/resource_names.
   * Format:
   * `projects/{project}/locations/{location}/instances/{instance}`
   * </pre>
   *
   * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
   *
   * @return The bytes for name.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      name_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int ID_FIELD_NUMBER = 11;

  @SuppressWarnings("serial")
  private volatile java.lang.Object id_ = "";
  /**
   *
   *
   * <pre>
   * Output only. An identifier for the `Instance`, generated by the backend.
   * </pre>
   *
   * <code>string id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The id.
   */
  @java.lang.Override
  public java.lang.String getId() {
    java.lang.Object ref = id_;
    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();
      id_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Output only. An identifier for the `Instance`, generated by the backend.
   * </pre>
   *
   * <code>string id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The bytes for id.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getIdBytes() {
    java.lang.Object ref = id_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      id_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CREATE_TIME_FIELD_NUMBER = 2;
  private com.google.protobuf.Timestamp createTime_;
  /**
   *
   *
   * <pre>
   * Output only. Create a time stamp.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return Whether the createTime field is set.
   */
  @java.lang.Override
  public boolean hasCreateTime() {
    return createTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * Output only. Create a time stamp.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The createTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getCreateTime() {
    return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
  }
  /**
   *
   *
   * <pre>
   * Output only. Create a time stamp.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
    return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
  }

  public static final int UPDATE_TIME_FIELD_NUMBER = 3;
  private com.google.protobuf.Timestamp updateTime_;
  /**
   *
   *
   * <pre>
   * Output only. Update a time stamp.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return Whether the updateTime field is set.
   */
  @java.lang.Override
  public boolean hasUpdateTime() {
    return updateTime_ != null;
  }
  /**
   *
   *
   * <pre>
   * Output only. Update a time stamp.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The updateTime.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getUpdateTime() {
    return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_;
  }
  /**
   *
   *
   * <pre>
   * Output only. Update a time stamp.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
    return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_;
  }

  public static final int MACHINE_TYPE_FIELD_NUMBER = 4;

  @SuppressWarnings("serial")
  private volatile java.lang.Object machineType_ = "";
  /**
   *
   *
   * <pre>
   * Immutable. The server type.
   * [Available server
   * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations)
   * </pre>
   *
   * <code>string machine_type = 4 [(.google.api.field_behavior) = IMMUTABLE];</code>
   *
   * @return The machineType.
   */
  @java.lang.Override
  public java.lang.String getMachineType() {
    java.lang.Object ref = machineType_;
    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();
      machineType_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Immutable. The server type.
   * [Available server
   * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations)
   * </pre>
   *
   * <code>string machine_type = 4 [(.google.api.field_behavior) = IMMUTABLE];</code>
   *
   * @return The bytes for machineType.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getMachineTypeBytes() {
    java.lang.Object ref = machineType_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      machineType_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int STATE_FIELD_NUMBER = 5;
  private int state_ = 0;
  /**
   *
   *
   * <pre>
   * Output only. The state of the server.
   * </pre>
   *
   * <code>
   * .google.cloud.baremetalsolution.v2.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The enum numeric value on the wire for state.
   */
  @java.lang.Override
  public int getStateValue() {
    return state_;
  }
  /**
   *
   *
   * <pre>
   * Output only. The state of the server.
   * </pre>
   *
   * <code>
   * .google.cloud.baremetalsolution.v2.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The state.
   */
  @java.lang.Override
  public com.google.cloud.baremetalsolution.v2.Instance.State getState() {
    com.google.cloud.baremetalsolution.v2.Instance.State result =
        com.google.cloud.baremetalsolution.v2.Instance.State.forNumber(state_);
    return result == null
        ? com.google.cloud.baremetalsolution.v2.Instance.State.UNRECOGNIZED
        : result;
  }

  public static final int HYPERTHREADING_ENABLED_FIELD_NUMBER = 6;
  private boolean hyperthreadingEnabled_ = false;
  /**
   *
   *
   * <pre>
   * True if you enable hyperthreading for the server, otherwise false.
   * The default value is false.
   * </pre>
   *
   * <code>bool hyperthreading_enabled = 6;</code>
   *
   * @return The hyperthreadingEnabled.
   */
  @java.lang.Override
  public boolean getHyperthreadingEnabled() {
    return hyperthreadingEnabled_;
  }

  public static final int LABELS_FIELD_NUMBER = 7;

  private static final class LabelsDefaultEntryHolder {
    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.baremetalsolution.v2.InstanceProto
                .internal_static_google_cloud_baremetalsolution_v2_Instance_LabelsEntry_descriptor,
            com.google.protobuf.WireFormat.FieldType.STRING,
            "",
            com.google.protobuf.WireFormat.FieldType.STRING,
            "");
  }

  @SuppressWarnings("serial")
  private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_;

  private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
    if (labels_ == null) {
      return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
    }
    return labels_;
  }

  public int getLabelsCount() {
    return internalGetLabels().getMap().size();
  }
  /**
   *
   *
   * <pre>
   * Labels as key value pairs.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 7;</code>
   */
  @java.lang.Override
  public boolean containsLabels(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    return internalGetLabels().getMap().containsKey(key);
  }
  /** Use {@link #getLabelsMap()} instead. */
  @java.lang.Override
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getLabels() {
    return getLabelsMap();
  }
  /**
   *
   *
   * <pre>
   * Labels as key value pairs.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 7;</code>
   */
  @java.lang.Override
  public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
    return internalGetLabels().getMap();
  }
  /**
   *
   *
   * <pre>
   * Labels as key value pairs.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 7;</code>
   */
  @java.lang.Override
  public /* nullable */ java.lang.String getLabelsOrDefault(
      java.lang.String key,
      /* nullable */
      java.lang.String defaultValue) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   *
   *
   * <pre>
   * Labels as key value pairs.
   * </pre>
   *
   * <code>map&lt;string, string&gt; labels = 7;</code>
   */
  @java.lang.Override
  public java.lang.String getLabelsOrThrow(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  public static final int LUNS_FIELD_NUMBER = 8;

  @SuppressWarnings("serial")
  private java.util.List<com.google.cloud.baremetalsolution.v2.Lun> luns_;
  /**
   *
   *
   * <pre>
   * Immutable. List of LUNs associated with this server.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
   * </code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.baremetalsolution.v2.Lun> getLunsList() {
    return luns_;
  }
  /**
   *
   *
   * <pre>
   * Immutable. List of LUNs associated with this server.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
   * </code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.baremetalsolution.v2.LunOrBuilder>
      getLunsOrBuilderList() {
    return luns_;
  }
  /**
   *
   *
   * <pre>
   * Immutable. List of LUNs associated with this server.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
   * </code>
   */
  @java.lang.Override
  public int getLunsCount() {
    return luns_.size();
  }
  /**
   *
   *
   * <pre>
   * Immutable. List of LUNs associated with this server.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.baremetalsolution.v2.Lun getLuns(int index) {
    return luns_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Immutable. List of LUNs associated with this server.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.baremetalsolution.v2.LunOrBuilder getLunsOrBuilder(int index) {
    return luns_.get(index);
  }

  public static final int VOLUMES_FIELD_NUMBER = 16;

  @SuppressWarnings("serial")
  private java.util.List<com.google.cloud.baremetalsolution.v2.Volume> volumes_;
  /**
   *
   *
   * <pre>
   * Input only. List of Volumes to attach to this Instance on creation.
   * This field won't be populated in Get/List responses.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.baremetalsolution.v2.Volume> getVolumesList() {
    return volumes_;
  }
  /**
   *
   *
   * <pre>
   * Input only. List of Volumes to attach to this Instance on creation.
   * This field won't be populated in Get/List responses.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.baremetalsolution.v2.VolumeOrBuilder>
      getVolumesOrBuilderList() {
    return volumes_;
  }
  /**
   *
   *
   * <pre>
   * Input only. List of Volumes to attach to this Instance on creation.
   * This field won't be populated in Get/List responses.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public int getVolumesCount() {
    return volumes_.size();
  }
  /**
   *
   *
   * <pre>
   * Input only. List of Volumes to attach to this Instance on creation.
   * This field won't be populated in Get/List responses.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.baremetalsolution.v2.Volume getVolumes(int index) {
    return volumes_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Input only. List of Volumes to attach to this Instance on creation.
   * This field won't be populated in Get/List responses.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.baremetalsolution.v2.VolumeOrBuilder getVolumesOrBuilder(int index) {
    return volumes_.get(index);
  }

  public static final int NETWORKS_FIELD_NUMBER = 9;

  @SuppressWarnings("serial")
  private java.util.List<com.google.cloud.baremetalsolution.v2.Network> networks_;
  /**
   *
   *
   * <pre>
   * Output only. List of networks associated with this server.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.baremetalsolution.v2.Network> getNetworksList() {
    return networks_;
  }
  /**
   *
   *
   * <pre>
   * Output only. List of networks associated with this server.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.baremetalsolution.v2.NetworkOrBuilder>
      getNetworksOrBuilderList() {
    return networks_;
  }
  /**
   *
   *
   * <pre>
   * Output only. List of networks associated with this server.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public int getNetworksCount() {
    return networks_.size();
  }
  /**
   *
   *
   * <pre>
   * Output only. List of networks associated with this server.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.baremetalsolution.v2.Network getNetworks(int index) {
    return networks_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Output only. List of networks associated with this server.
   * </pre>
   *
   * <code>
   * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.baremetalsolution.v2.NetworkOrBuilder getNetworksOrBuilder(int index) {
    return networks_.get(index);
  }

  public static final int INTERACTIVE_SERIAL_CONSOLE_ENABLED_FIELD_NUMBER = 10;
  private boolean interactiveSerialConsoleEnabled_ = false;
  /**
   *
   *
   * <pre>
   * Output only. True if the interactive serial console feature is enabled for
   * the instance, false otherwise. The default value is false.
   * </pre>
   *
   * <code>
   * bool interactive_serial_console_enabled = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
   * </code>
   *
   * @return The interactiveSerialConsoleEnabled.
   */
  @java.lang.Override
  public boolean getInteractiveSerialConsoleEnabled() {
    return interactiveSerialConsoleEnabled_;
  }

  public static final int OS_IMAGE_FIELD_NUMBER = 12;

  @SuppressWarnings("serial")
  private volatile java.lang.Object osImage_ = "";
  /**
   *
   *
   * <pre>
   * The OS image currently installed on the server.
   * </pre>
   *
   * <code>string os_image = 12;</code>
   *
   * @return The osImage.
   */
  @java.lang.Override
  public java.lang.String getOsImage() {
    java.lang.Object ref = osImage_;
    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();
      osImage_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The OS image currently installed on the server.
   * </pre>
   *
   * <code>string os_image = 12;</code>
   *
   * @return The bytes for osImage.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getOsImageBytes() {
    java.lang.Object ref = osImage_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      osImage_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int POD_FIELD_NUMBER = 13;

  @SuppressWarnings("serial")
  private volatile java.lang.Object pod_ = "";
  /**
   *
   *
   * <pre>
   * Immutable. Pod name.
   * Pod is an independent part of infrastructure.
   * Instance can be connected to the assets (networks, volumes) allocated
   * in the same pod only.
   * </pre>
   *
   * <code>string pod = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
   *
   * @return The pod.
   */
  @java.lang.Override
  public java.lang.String getPod() {
    java.lang.Object ref = pod_;
    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();
      pod_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Immutable. Pod name.
   * Pod is an independent part of infrastructure.
   * Instance can be connected to the assets (networks, volumes) allocated
   * in the same pod only.
   * </pre>
   *
   * <code>string pod = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
   *
   * @return The bytes for pod.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getPodBytes() {
    java.lang.Object ref = pod_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      pod_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int NETWORK_TEMPLATE_FIELD_NUMBER = 14;

  @SuppressWarnings("serial")
  private volatile java.lang.Object networkTemplate_ = "";
  /**
   *
   *
   * <pre>
   * Instance network template name. For eg, bondaa-bondaa, bondab-nic, etc.
   * Generally, the template name follows the syntax of
   * "bond&lt;bond_mode&gt;" or "nic".
   * </pre>
   *
   * <code>string network_template = 14 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The networkTemplate.
   */
  @java.lang.Override
  public java.lang.String getNetworkTemplate() {
    java.lang.Object ref = networkTemplate_;
    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();
      networkTemplate_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Instance network template name. For eg, bondaa-bondaa, bondab-nic, etc.
   * Generally, the template name follows the syntax of
   * "bond&lt;bond_mode&gt;" or "nic".
   * </pre>
   *
   * <code>string network_template = 14 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The bytes for networkTemplate.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getNetworkTemplateBytes() {
    java.lang.Object ref = networkTemplate_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      networkTemplate_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int LOGICAL_INTERFACES_FIELD_NUMBER = 15;

  @SuppressWarnings("serial")
  private java.util.List<com.google.cloud.baremetalsolution.v2.LogicalInterface> logicalInterfaces_;
  /**
   *
   *
   * <pre>
   * List of logical interfaces for the instance. The number of logical
   * interfaces will be the same as number of hardware bond/nic on the chosen
   * network template. For the non-multivlan configurations (for eg, existing
   * servers) that use existing default network template (bondaa-bondaa), both
   * the Instance.networks field and the Instance.logical_interfaces fields will
   * be filled to ensure backward compatibility. For the others, only
   * Instance.logical_interfaces will be filled.
   * </pre>
   *
   * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
   * </code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.baremetalsolution.v2.LogicalInterface>
      getLogicalInterfacesList() {
    return logicalInterfaces_;
  }
  /**
   *
   *
   * <pre>
   * List of logical interfaces for the instance. The number of logical
   * interfaces will be the same as number of hardware bond/nic on the chosen
   * network template. For the non-multivlan configurations (for eg, existing
   * servers) that use existing default network template (bondaa-bondaa), both
   * the Instance.networks field and the Instance.logical_interfaces fields will
   * be filled to ensure backward compatibility. For the others, only
   * Instance.logical_interfaces will be filled.
   * </pre>
   *
   * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
   * </code>
   */
  @java.lang.Override
  public java.util.List<? extends com.google.cloud.baremetalsolution.v2.LogicalInterfaceOrBuilder>
      getLogicalInterfacesOrBuilderList() {
    return logicalInterfaces_;
  }
  /**
   *
   *
   * <pre>
   * List of logical interfaces for the instance. The number of logical
   * interfaces will be the same as number of hardware bond/nic on the chosen
   * network template. For the non-multivlan configurations (for eg, existing
   * servers) that use existing default network template (bondaa-bondaa), both
   * the Instance.networks field and the Instance.logical_interfaces fields will
   * be filled to ensure backward compatibility. For the others, only
   * Instance.logical_interfaces will be filled.
   * </pre>
   *
   * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
   * </code>
   */
  @java.lang.Override
  public int getLogicalInterfacesCount() {
    return logicalInterfaces_.size();
  }
  /**
   *
   *
   * <pre>
   * List of logical interfaces for the instance. The number of logical
   * interfaces will be the same as number of hardware bond/nic on the chosen
   * network template. For the non-multivlan configurations (for eg, existing
   * servers) that use existing default network template (bondaa-bondaa), both
   * the Instance.networks field and the Instance.logical_interfaces fields will
   * be filled to ensure backward compatibility. For the others, only
   * Instance.logical_interfaces will be filled.
   * </pre>
   *
   * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.baremetalsolution.v2.LogicalInterface getLogicalInterfaces(int index) {
    return logicalInterfaces_.get(index);
  }
  /**
   *
   *
   * <pre>
   * List of logical interfaces for the instance. The number of logical
   * interfaces will be the same as number of hardware bond/nic on the chosen
   * network template. For the non-multivlan configurations (for eg, existing
   * servers) that use existing default network template (bondaa-bondaa), both
   * the Instance.networks field and the Instance.logical_interfaces fields will
   * be filled to ensure backward compatibility. For the others, only
   * Instance.logical_interfaces will be filled.
   * </pre>
   *
   * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.baremetalsolution.v2.LogicalInterfaceOrBuilder
      getLogicalInterfacesOrBuilder(int index) {
    return logicalInterfaces_.get(index);
  }

  public static final int LOGIN_INFO_FIELD_NUMBER = 17;

  @SuppressWarnings("serial")
  private volatile java.lang.Object loginInfo_ = "";
  /**
   *
   *
   * <pre>
   * Output only. Text field about info for logging in.
   * </pre>
   *
   * <code>string login_info = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The loginInfo.
   */
  @java.lang.Override
  public java.lang.String getLoginInfo() {
    java.lang.Object ref = loginInfo_;
    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();
      loginInfo_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Output only. Text field about info for logging in.
   * </pre>
   *
   * <code>string login_info = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The bytes for loginInfo.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getLoginInfoBytes() {
    java.lang.Object ref = loginInfo_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      loginInfo_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int WORKLOAD_PROFILE_FIELD_NUMBER = 18;
  private int workloadProfile_ = 0;
  /**
   *
   *
   * <pre>
   * The workload profile for the instance.
   * </pre>
   *
   * <code>.google.cloud.baremetalsolution.v2.WorkloadProfile workload_profile = 18;</code>
   *
   * @return The enum numeric value on the wire for workloadProfile.
   */
  @java.lang.Override
  public int getWorkloadProfileValue() {
    return workloadProfile_;
  }
  /**
   *
   *
   * <pre>
   * The workload profile for the instance.
   * </pre>
   *
   * <code>.google.cloud.baremetalsolution.v2.WorkloadProfile workload_profile = 18;</code>
   *
   * @return The workloadProfile.
   */
  @java.lang.Override
  public com.google.cloud.baremetalsolution.v2.WorkloadProfile getWorkloadProfile() {
    com.google.cloud.baremetalsolution.v2.WorkloadProfile result =
        com.google.cloud.baremetalsolution.v2.WorkloadProfile.forNumber(workloadProfile_);
    return result == null
        ? com.google.cloud.baremetalsolution.v2.WorkloadProfile.UNRECOGNIZED
        : result;
  }

  public static final int FIRMWARE_VERSION_FIELD_NUMBER = 19;

  @SuppressWarnings("serial")
  private volatile java.lang.Object firmwareVersion_ = "";
  /**
   *
   *
   * <pre>
   * Output only. The firmware version for the instance.
   * </pre>
   *
   * <code>string firmware_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The firmwareVersion.
   */
  @java.lang.Override
  public java.lang.String getFirmwareVersion() {
    java.lang.Object ref = firmwareVersion_;
    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();
      firmwareVersion_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Output only. The firmware version for the instance.
   * </pre>
   *
   * <code>string firmware_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   *
   * @return The bytes for firmwareVersion.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getFirmwareVersionBytes() {
    java.lang.Object ref = firmwareVersion_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      firmwareVersion_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (createTime_ != null) {
      output.writeMessage(2, getCreateTime());
    }
    if (updateTime_ != null) {
      output.writeMessage(3, getUpdateTime());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(machineType_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, machineType_);
    }
    if (state_
        != com.google.cloud.baremetalsolution.v2.Instance.State.STATE_UNSPECIFIED.getNumber()) {
      output.writeEnum(5, state_);
    }
    if (hyperthreadingEnabled_ != false) {
      output.writeBool(6, hyperthreadingEnabled_);
    }
    com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 7);
    for (int i = 0; i < luns_.size(); i++) {
      output.writeMessage(8, luns_.get(i));
    }
    for (int i = 0; i < networks_.size(); i++) {
      output.writeMessage(9, networks_.get(i));
    }
    if (interactiveSerialConsoleEnabled_ != false) {
      output.writeBool(10, interactiveSerialConsoleEnabled_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 11, id_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(osImage_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 12, osImage_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pod_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 13, pod_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(networkTemplate_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 14, networkTemplate_);
    }
    for (int i = 0; i < logicalInterfaces_.size(); i++) {
      output.writeMessage(15, logicalInterfaces_.get(i));
    }
    for (int i = 0; i < volumes_.size(); i++) {
      output.writeMessage(16, volumes_.get(i));
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(loginInfo_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 17, loginInfo_);
    }
    if (workloadProfile_
        != com.google.cloud.baremetalsolution.v2.WorkloadProfile.WORKLOAD_PROFILE_UNSPECIFIED
            .getNumber()) {
      output.writeEnum(18, workloadProfile_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(firmwareVersion_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 19, firmwareVersion_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (createTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime());
    }
    if (updateTime_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(machineType_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, machineType_);
    }
    if (state_
        != com.google.cloud.baremetalsolution.v2.Instance.State.STATE_UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_);
    }
    if (hyperthreadingEnabled_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, hyperthreadingEnabled_);
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
        internalGetLabels().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
          LabelsDefaultEntryHolder.defaultEntry
              .newBuilderForType()
              .setKey(entry.getKey())
              .setValue(entry.getValue())
              .build();
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, labels__);
    }
    for (int i = 0; i < luns_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, luns_.get(i));
    }
    for (int i = 0; i < networks_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, networks_.get(i));
    }
    if (interactiveSerialConsoleEnabled_ != false) {
      size +=
          com.google.protobuf.CodedOutputStream.computeBoolSize(
              10, interactiveSerialConsoleEnabled_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, id_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(osImage_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, osImage_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pod_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, pod_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(networkTemplate_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, networkTemplate_);
    }
    for (int i = 0; i < logicalInterfaces_.size(); i++) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(15, logicalInterfaces_.get(i));
    }
    for (int i = 0; i < volumes_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, volumes_.get(i));
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(loginInfo_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, loginInfo_);
    }
    if (workloadProfile_
        != com.google.cloud.baremetalsolution.v2.WorkloadProfile.WORKLOAD_PROFILE_UNSPECIFIED
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(18, workloadProfile_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(firmwareVersion_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(19, firmwareVersion_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

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

    if (!getName().equals(other.getName())) return false;
    if (!getId().equals(other.getId())) return false;
    if (hasCreateTime() != other.hasCreateTime()) return false;
    if (hasCreateTime()) {
      if (!getCreateTime().equals(other.getCreateTime())) return false;
    }
    if (hasUpdateTime() != other.hasUpdateTime()) return false;
    if (hasUpdateTime()) {
      if (!getUpdateTime().equals(other.getUpdateTime())) return false;
    }
    if (!getMachineType().equals(other.getMachineType())) return false;
    if (state_ != other.state_) return false;
    if (getHyperthreadingEnabled() != other.getHyperthreadingEnabled()) return false;
    if (!internalGetLabels().equals(other.internalGetLabels())) return false;
    if (!getLunsList().equals(other.getLunsList())) return false;
    if (!getVolumesList().equals(other.getVolumesList())) return false;
    if (!getNetworksList().equals(other.getNetworksList())) return false;
    if (getInteractiveSerialConsoleEnabled() != other.getInteractiveSerialConsoleEnabled())
      return false;
    if (!getOsImage().equals(other.getOsImage())) return false;
    if (!getPod().equals(other.getPod())) return false;
    if (!getNetworkTemplate().equals(other.getNetworkTemplate())) return false;
    if (!getLogicalInterfacesList().equals(other.getLogicalInterfacesList())) return false;
    if (!getLoginInfo().equals(other.getLoginInfo())) return false;
    if (workloadProfile_ != other.workloadProfile_) return false;
    if (!getFirmwareVersion().equals(other.getFirmwareVersion())) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    hash = (37 * hash) + ID_FIELD_NUMBER;
    hash = (53 * hash) + getId().hashCode();
    if (hasCreateTime()) {
      hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getCreateTime().hashCode();
    }
    if (hasUpdateTime()) {
      hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER;
      hash = (53 * hash) + getUpdateTime().hashCode();
    }
    hash = (37 * hash) + MACHINE_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + getMachineType().hashCode();
    hash = (37 * hash) + STATE_FIELD_NUMBER;
    hash = (53 * hash) + state_;
    hash = (37 * hash) + HYPERTHREADING_ENABLED_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getHyperthreadingEnabled());
    if (!internalGetLabels().getMap().isEmpty()) {
      hash = (37 * hash) + LABELS_FIELD_NUMBER;
      hash = (53 * hash) + internalGetLabels().hashCode();
    }
    if (getLunsCount() > 0) {
      hash = (37 * hash) + LUNS_FIELD_NUMBER;
      hash = (53 * hash) + getLunsList().hashCode();
    }
    if (getVolumesCount() > 0) {
      hash = (37 * hash) + VOLUMES_FIELD_NUMBER;
      hash = (53 * hash) + getVolumesList().hashCode();
    }
    if (getNetworksCount() > 0) {
      hash = (37 * hash) + NETWORKS_FIELD_NUMBER;
      hash = (53 * hash) + getNetworksList().hashCode();
    }
    hash = (37 * hash) + INTERACTIVE_SERIAL_CONSOLE_ENABLED_FIELD_NUMBER;
    hash =
        (53 * hash)
            + com.google.protobuf.Internal.hashBoolean(getInteractiveSerialConsoleEnabled());
    hash = (37 * hash) + OS_IMAGE_FIELD_NUMBER;
    hash = (53 * hash) + getOsImage().hashCode();
    hash = (37 * hash) + POD_FIELD_NUMBER;
    hash = (53 * hash) + getPod().hashCode();
    hash = (37 * hash) + NETWORK_TEMPLATE_FIELD_NUMBER;
    hash = (53 * hash) + getNetworkTemplate().hashCode();
    if (getLogicalInterfacesCount() > 0) {
      hash = (37 * hash) + LOGICAL_INTERFACES_FIELD_NUMBER;
      hash = (53 * hash) + getLogicalInterfacesList().hashCode();
    }
    hash = (37 * hash) + LOGIN_INFO_FIELD_NUMBER;
    hash = (53 * hash) + getLoginInfo().hashCode();
    hash = (37 * hash) + WORKLOAD_PROFILE_FIELD_NUMBER;
    hash = (53 * hash) + workloadProfile_;
    hash = (37 * hash) + FIRMWARE_VERSION_FIELD_NUMBER;
    hash = (53 * hash) + getFirmwareVersion().hashCode();
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.baremetalsolution.v2.Instance parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

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

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

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

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

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

  public static com.google.cloud.baremetalsolution.v2.Instance 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.baremetalsolution.v2.Instance 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>
   * A server.
   * </pre>
   *
   * Protobuf type {@code google.cloud.baremetalsolution.v2.Instance}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.baremetalsolution.v2.Instance)
      com.google.cloud.baremetalsolution.v2.InstanceOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.baremetalsolution.v2.InstanceProto
          .internal_static_google_cloud_baremetalsolution_v2_Instance_descriptor;
    }

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

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

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.baremetalsolution.v2.InstanceProto
          .internal_static_google_cloud_baremetalsolution_v2_Instance_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.baremetalsolution.v2.Instance.class,
              com.google.cloud.baremetalsolution.v2.Instance.Builder.class);
    }

    // Construct using com.google.cloud.baremetalsolution.v2.Instance.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      name_ = "";
      id_ = "";
      createTime_ = null;
      if (createTimeBuilder_ != null) {
        createTimeBuilder_.dispose();
        createTimeBuilder_ = null;
      }
      updateTime_ = null;
      if (updateTimeBuilder_ != null) {
        updateTimeBuilder_.dispose();
        updateTimeBuilder_ = null;
      }
      machineType_ = "";
      state_ = 0;
      hyperthreadingEnabled_ = false;
      internalGetMutableLabels().clear();
      if (lunsBuilder_ == null) {
        luns_ = java.util.Collections.emptyList();
      } else {
        luns_ = null;
        lunsBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000100);
      if (volumesBuilder_ == null) {
        volumes_ = java.util.Collections.emptyList();
      } else {
        volumes_ = null;
        volumesBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000200);
      if (networksBuilder_ == null) {
        networks_ = java.util.Collections.emptyList();
      } else {
        networks_ = null;
        networksBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000400);
      interactiveSerialConsoleEnabled_ = false;
      osImage_ = "";
      pod_ = "";
      networkTemplate_ = "";
      if (logicalInterfacesBuilder_ == null) {
        logicalInterfaces_ = java.util.Collections.emptyList();
      } else {
        logicalInterfaces_ = null;
        logicalInterfacesBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00008000);
      loginInfo_ = "";
      workloadProfile_ = 0;
      firmwareVersion_ = "";
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.baremetalsolution.v2.InstanceProto
          .internal_static_google_cloud_baremetalsolution_v2_Instance_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.baremetalsolution.v2.Instance getDefaultInstanceForType() {
      return com.google.cloud.baremetalsolution.v2.Instance.getDefaultInstance();
    }

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

    @java.lang.Override
    public com.google.cloud.baremetalsolution.v2.Instance buildPartial() {
      com.google.cloud.baremetalsolution.v2.Instance result =
          new com.google.cloud.baremetalsolution.v2.Instance(this);
      buildPartialRepeatedFields(result);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartialRepeatedFields(com.google.cloud.baremetalsolution.v2.Instance result) {
      if (lunsBuilder_ == null) {
        if (((bitField0_ & 0x00000100) != 0)) {
          luns_ = java.util.Collections.unmodifiableList(luns_);
          bitField0_ = (bitField0_ & ~0x00000100);
        }
        result.luns_ = luns_;
      } else {
        result.luns_ = lunsBuilder_.build();
      }
      if (volumesBuilder_ == null) {
        if (((bitField0_ & 0x00000200) != 0)) {
          volumes_ = java.util.Collections.unmodifiableList(volumes_);
          bitField0_ = (bitField0_ & ~0x00000200);
        }
        result.volumes_ = volumes_;
      } else {
        result.volumes_ = volumesBuilder_.build();
      }
      if (networksBuilder_ == null) {
        if (((bitField0_ & 0x00000400) != 0)) {
          networks_ = java.util.Collections.unmodifiableList(networks_);
          bitField0_ = (bitField0_ & ~0x00000400);
        }
        result.networks_ = networks_;
      } else {
        result.networks_ = networksBuilder_.build();
      }
      if (logicalInterfacesBuilder_ == null) {
        if (((bitField0_ & 0x00008000) != 0)) {
          logicalInterfaces_ = java.util.Collections.unmodifiableList(logicalInterfaces_);
          bitField0_ = (bitField0_ & ~0x00008000);
        }
        result.logicalInterfaces_ = logicalInterfaces_;
      } else {
        result.logicalInterfaces_ = logicalInterfacesBuilder_.build();
      }
    }

    private void buildPartial0(com.google.cloud.baremetalsolution.v2.Instance result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.name_ = name_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.id_ = id_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.machineType_ = machineType_;
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.state_ = state_;
      }
      if (((from_bitField0_ & 0x00000040) != 0)) {
        result.hyperthreadingEnabled_ = hyperthreadingEnabled_;
      }
      if (((from_bitField0_ & 0x00000080) != 0)) {
        result.labels_ = internalGetLabels();
        result.labels_.makeImmutable();
      }
      if (((from_bitField0_ & 0x00000800) != 0)) {
        result.interactiveSerialConsoleEnabled_ = interactiveSerialConsoleEnabled_;
      }
      if (((from_bitField0_ & 0x00001000) != 0)) {
        result.osImage_ = osImage_;
      }
      if (((from_bitField0_ & 0x00002000) != 0)) {
        result.pod_ = pod_;
      }
      if (((from_bitField0_ & 0x00004000) != 0)) {
        result.networkTemplate_ = networkTemplate_;
      }
      if (((from_bitField0_ & 0x00010000) != 0)) {
        result.loginInfo_ = loginInfo_;
      }
      if (((from_bitField0_ & 0x00020000) != 0)) {
        result.workloadProfile_ = workloadProfile_;
      }
      if (((from_bitField0_ & 0x00040000) != 0)) {
        result.firmwareVersion_ = firmwareVersion_;
      }
    }

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

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

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

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

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

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

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

    public Builder mergeFrom(com.google.cloud.baremetalsolution.v2.Instance other) {
      if (other == com.google.cloud.baremetalsolution.v2.Instance.getDefaultInstance()) return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getId().isEmpty()) {
        id_ = other.id_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (other.hasCreateTime()) {
        mergeCreateTime(other.getCreateTime());
      }
      if (other.hasUpdateTime()) {
        mergeUpdateTime(other.getUpdateTime());
      }
      if (!other.getMachineType().isEmpty()) {
        machineType_ = other.machineType_;
        bitField0_ |= 0x00000010;
        onChanged();
      }
      if (other.state_ != 0) {
        setStateValue(other.getStateValue());
      }
      if (other.getHyperthreadingEnabled() != false) {
        setHyperthreadingEnabled(other.getHyperthreadingEnabled());
      }
      internalGetMutableLabels().mergeFrom(other.internalGetLabels());
      bitField0_ |= 0x00000080;
      if (lunsBuilder_ == null) {
        if (!other.luns_.isEmpty()) {
          if (luns_.isEmpty()) {
            luns_ = other.luns_;
            bitField0_ = (bitField0_ & ~0x00000100);
          } else {
            ensureLunsIsMutable();
            luns_.addAll(other.luns_);
          }
          onChanged();
        }
      } else {
        if (!other.luns_.isEmpty()) {
          if (lunsBuilder_.isEmpty()) {
            lunsBuilder_.dispose();
            lunsBuilder_ = null;
            luns_ = other.luns_;
            bitField0_ = (bitField0_ & ~0x00000100);
            lunsBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getLunsFieldBuilder()
                    : null;
          } else {
            lunsBuilder_.addAllMessages(other.luns_);
          }
        }
      }
      if (volumesBuilder_ == null) {
        if (!other.volumes_.isEmpty()) {
          if (volumes_.isEmpty()) {
            volumes_ = other.volumes_;
            bitField0_ = (bitField0_ & ~0x00000200);
          } else {
            ensureVolumesIsMutable();
            volumes_.addAll(other.volumes_);
          }
          onChanged();
        }
      } else {
        if (!other.volumes_.isEmpty()) {
          if (volumesBuilder_.isEmpty()) {
            volumesBuilder_.dispose();
            volumesBuilder_ = null;
            volumes_ = other.volumes_;
            bitField0_ = (bitField0_ & ~0x00000200);
            volumesBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getVolumesFieldBuilder()
                    : null;
          } else {
            volumesBuilder_.addAllMessages(other.volumes_);
          }
        }
      }
      if (networksBuilder_ == null) {
        if (!other.networks_.isEmpty()) {
          if (networks_.isEmpty()) {
            networks_ = other.networks_;
            bitField0_ = (bitField0_ & ~0x00000400);
          } else {
            ensureNetworksIsMutable();
            networks_.addAll(other.networks_);
          }
          onChanged();
        }
      } else {
        if (!other.networks_.isEmpty()) {
          if (networksBuilder_.isEmpty()) {
            networksBuilder_.dispose();
            networksBuilder_ = null;
            networks_ = other.networks_;
            bitField0_ = (bitField0_ & ~0x00000400);
            networksBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getNetworksFieldBuilder()
                    : null;
          } else {
            networksBuilder_.addAllMessages(other.networks_);
          }
        }
      }
      if (other.getInteractiveSerialConsoleEnabled() != false) {
        setInteractiveSerialConsoleEnabled(other.getInteractiveSerialConsoleEnabled());
      }
      if (!other.getOsImage().isEmpty()) {
        osImage_ = other.osImage_;
        bitField0_ |= 0x00001000;
        onChanged();
      }
      if (!other.getPod().isEmpty()) {
        pod_ = other.pod_;
        bitField0_ |= 0x00002000;
        onChanged();
      }
      if (!other.getNetworkTemplate().isEmpty()) {
        networkTemplate_ = other.networkTemplate_;
        bitField0_ |= 0x00004000;
        onChanged();
      }
      if (logicalInterfacesBuilder_ == null) {
        if (!other.logicalInterfaces_.isEmpty()) {
          if (logicalInterfaces_.isEmpty()) {
            logicalInterfaces_ = other.logicalInterfaces_;
            bitField0_ = (bitField0_ & ~0x00008000);
          } else {
            ensureLogicalInterfacesIsMutable();
            logicalInterfaces_.addAll(other.logicalInterfaces_);
          }
          onChanged();
        }
      } else {
        if (!other.logicalInterfaces_.isEmpty()) {
          if (logicalInterfacesBuilder_.isEmpty()) {
            logicalInterfacesBuilder_.dispose();
            logicalInterfacesBuilder_ = null;
            logicalInterfaces_ = other.logicalInterfaces_;
            bitField0_ = (bitField0_ & ~0x00008000);
            logicalInterfacesBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getLogicalInterfacesFieldBuilder()
                    : null;
          } else {
            logicalInterfacesBuilder_.addAllMessages(other.logicalInterfaces_);
          }
        }
      }
      if (!other.getLoginInfo().isEmpty()) {
        loginInfo_ = other.loginInfo_;
        bitField0_ |= 0x00010000;
        onChanged();
      }
      if (other.workloadProfile_ != 0) {
        setWorkloadProfileValue(other.getWorkloadProfileValue());
      }
      if (!other.getFirmwareVersion().isEmpty()) {
        firmwareVersion_ = other.firmwareVersion_;
        bitField0_ |= 0x00040000;
        onChanged();
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                name_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000004;
                break;
              } // case 18
            case 26:
              {
                input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000008;
                break;
              } // case 26
            case 34:
              {
                machineType_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000010;
                break;
              } // case 34
            case 40:
              {
                state_ = input.readEnum();
                bitField0_ |= 0x00000020;
                break;
              } // case 40
            case 48:
              {
                hyperthreadingEnabled_ = input.readBool();
                bitField0_ |= 0x00000040;
                break;
              } // case 48
            case 58:
              {
                com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
                    input.readMessage(
                        LabelsDefaultEntryHolder.defaultEntry.getParserForType(),
                        extensionRegistry);
                internalGetMutableLabels()
                    .getMutableMap()
                    .put(labels__.getKey(), labels__.getValue());
                bitField0_ |= 0x00000080;
                break;
              } // case 58
            case 66:
              {
                com.google.cloud.baremetalsolution.v2.Lun m =
                    input.readMessage(
                        com.google.cloud.baremetalsolution.v2.Lun.parser(), extensionRegistry);
                if (lunsBuilder_ == null) {
                  ensureLunsIsMutable();
                  luns_.add(m);
                } else {
                  lunsBuilder_.addMessage(m);
                }
                break;
              } // case 66
            case 74:
              {
                com.google.cloud.baremetalsolution.v2.Network m =
                    input.readMessage(
                        com.google.cloud.baremetalsolution.v2.Network.parser(), extensionRegistry);
                if (networksBuilder_ == null) {
                  ensureNetworksIsMutable();
                  networks_.add(m);
                } else {
                  networksBuilder_.addMessage(m);
                }
                break;
              } // case 74
            case 80:
              {
                interactiveSerialConsoleEnabled_ = input.readBool();
                bitField0_ |= 0x00000800;
                break;
              } // case 80
            case 90:
              {
                id_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 90
            case 98:
              {
                osImage_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00001000;
                break;
              } // case 98
            case 106:
              {
                pod_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00002000;
                break;
              } // case 106
            case 114:
              {
                networkTemplate_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00004000;
                break;
              } // case 114
            case 122:
              {
                com.google.cloud.baremetalsolution.v2.LogicalInterface m =
                    input.readMessage(
                        com.google.cloud.baremetalsolution.v2.LogicalInterface.parser(),
                        extensionRegistry);
                if (logicalInterfacesBuilder_ == null) {
                  ensureLogicalInterfacesIsMutable();
                  logicalInterfaces_.add(m);
                } else {
                  logicalInterfacesBuilder_.addMessage(m);
                }
                break;
              } // case 122
            case 130:
              {
                com.google.cloud.baremetalsolution.v2.Volume m =
                    input.readMessage(
                        com.google.cloud.baremetalsolution.v2.Volume.parser(), extensionRegistry);
                if (volumesBuilder_ == null) {
                  ensureVolumesIsMutable();
                  volumes_.add(m);
                } else {
                  volumesBuilder_.addMessage(m);
                }
                break;
              } // case 130
            case 138:
              {
                loginInfo_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00010000;
                break;
              } // case 138
            case 144:
              {
                workloadProfile_ = input.readEnum();
                bitField0_ |= 0x00020000;
                break;
              } // case 144
            case 154:
              {
                firmwareVersion_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00040000;
                break;
              } // case 154
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * Immutable. The resource name of this `Instance`.
     * Resource names are schemeless URIs that follow the conventions in
     * https://cloud.google.com/apis/design/resource_names.
     * Format:
     * `projects/{project}/locations/{location}/instances/{instance}`
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return The name.
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. The resource name of this `Instance`.
     * Resource names are schemeless URIs that follow the conventions in
     * https://cloud.google.com/apis/design/resource_names.
     * Format:
     * `projects/{project}/locations/{location}/instances/{instance}`
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return The bytes for name.
     */
    public com.google.protobuf.ByteString getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. The resource name of this `Instance`.
     * Resource names are schemeless URIs that follow the conventions in
     * https://cloud.google.com/apis/design/resource_names.
     * Format:
     * `projects/{project}/locations/{location}/instances/{instance}`
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param value The name to set.
     * @return This builder for chaining.
     */
    public Builder setName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      name_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. The resource name of this `Instance`.
     * Resource names are schemeless URIs that follow the conventions in
     * https://cloud.google.com/apis/design/resource_names.
     * Format:
     * `projects/{project}/locations/{location}/instances/{instance}`
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {
      name_ = getDefaultInstance().getName();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. The resource name of this `Instance`.
     * Resource names are schemeless URIs that follow the conventions in
     * https://cloud.google.com/apis/design/resource_names.
     * Format:
     * `projects/{project}/locations/{location}/instances/{instance}`
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param value The bytes for name to set.
     * @return This builder for chaining.
     */
    public Builder setNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      name_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private java.lang.Object id_ = "";
    /**
     *
     *
     * <pre>
     * Output only. An identifier for the `Instance`, generated by the backend.
     * </pre>
     *
     * <code>string id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The id.
     */
    public java.lang.String getId() {
      java.lang.Object ref = id_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        id_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. An identifier for the `Instance`, generated by the backend.
     * </pre>
     *
     * <code>string id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The bytes for id.
     */
    public com.google.protobuf.ByteString getIdBytes() {
      java.lang.Object ref = id_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        id_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. An identifier for the `Instance`, generated by the backend.
     * </pre>
     *
     * <code>string id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The id to set.
     * @return This builder for chaining.
     */
    public Builder setId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      id_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. An identifier for the `Instance`, generated by the backend.
     * </pre>
     *
     * <code>string id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearId() {
      id_ = getDefaultInstance().getId();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. An identifier for the `Instance`, generated by the backend.
     * </pre>
     *
     * <code>string id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The bytes for id to set.
     * @return This builder for chaining.
     */
    public Builder setIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      id_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private com.google.protobuf.Timestamp createTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        createTimeBuilder_;
    /**
     *
     *
     * <pre>
     * Output only. Create a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return Whether the createTime field is set.
     */
    public boolean hasCreateTime() {
      return ((bitField0_ & 0x00000004) != 0);
    }
    /**
     *
     *
     * <pre>
     * Output only. Create a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The createTime.
     */
    public com.google.protobuf.Timestamp getCreateTime() {
      if (createTimeBuilder_ == null) {
        return createTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : createTime_;
      } else {
        return createTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Create a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setCreateTime(com.google.protobuf.Timestamp value) {
      if (createTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        createTime_ = value;
      } else {
        createTimeBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Create a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (createTimeBuilder_ == null) {
        createTime_ = builderForValue.build();
      } else {
        createTimeBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Create a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder mergeCreateTime(com.google.protobuf.Timestamp value) {
      if (createTimeBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0)
            && createTime_ != null
            && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          getCreateTimeBuilder().mergeFrom(value);
        } else {
          createTime_ = value;
        }
      } else {
        createTimeBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Create a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder clearCreateTime() {
      bitField0_ = (bitField0_ & ~0x00000004);
      createTime_ = null;
      if (createTimeBuilder_ != null) {
        createTimeBuilder_.dispose();
        createTimeBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Create a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() {
      bitField0_ |= 0x00000004;
      onChanged();
      return getCreateTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Output only. Create a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
      if (createTimeBuilder_ != null) {
        return createTimeBuilder_.getMessageOrBuilder();
      } else {
        return createTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : createTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Create a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getCreateTimeFieldBuilder() {
      if (createTimeBuilder_ == null) {
        createTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getCreateTime(), getParentForChildren(), isClean());
        createTime_ = null;
      }
      return createTimeBuilder_;
    }

    private com.google.protobuf.Timestamp updateTime_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        updateTimeBuilder_;
    /**
     *
     *
     * <pre>
     * Output only. Update a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return Whether the updateTime field is set.
     */
    public boolean hasUpdateTime() {
      return ((bitField0_ & 0x00000008) != 0);
    }
    /**
     *
     *
     * <pre>
     * Output only. Update a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The updateTime.
     */
    public com.google.protobuf.Timestamp getUpdateTime() {
      if (updateTimeBuilder_ == null) {
        return updateTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : updateTime_;
      } else {
        return updateTimeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Update a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setUpdateTime(com.google.protobuf.Timestamp value) {
      if (updateTimeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        updateTime_ = value;
      } else {
        updateTimeBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Update a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (updateTimeBuilder_ == null) {
        updateTime_ = builderForValue.build();
      } else {
        updateTimeBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Update a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) {
      if (updateTimeBuilder_ == null) {
        if (((bitField0_ & 0x00000008) != 0)
            && updateTime_ != null
            && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          getUpdateTimeBuilder().mergeFrom(value);
        } else {
          updateTime_ = value;
        }
      } else {
        updateTimeBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Update a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder clearUpdateTime() {
      bitField0_ = (bitField0_ & ~0x00000008);
      updateTime_ = null;
      if (updateTimeBuilder_ != null) {
        updateTimeBuilder_.dispose();
        updateTimeBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Update a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() {
      bitField0_ |= 0x00000008;
      onChanged();
      return getUpdateTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Output only. Update a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
      if (updateTimeBuilder_ != null) {
        return updateTimeBuilder_.getMessageOrBuilder();
      } else {
        return updateTime_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : updateTime_;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Update a time stamp.
     * </pre>
     *
     * <code>
     * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getUpdateTimeFieldBuilder() {
      if (updateTimeBuilder_ == null) {
        updateTimeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getUpdateTime(), getParentForChildren(), isClean());
        updateTime_ = null;
      }
      return updateTimeBuilder_;
    }

    private java.lang.Object machineType_ = "";
    /**
     *
     *
     * <pre>
     * Immutable. The server type.
     * [Available server
     * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations)
     * </pre>
     *
     * <code>string machine_type = 4 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return The machineType.
     */
    public java.lang.String getMachineType() {
      java.lang.Object ref = machineType_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        machineType_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. The server type.
     * [Available server
     * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations)
     * </pre>
     *
     * <code>string machine_type = 4 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return The bytes for machineType.
     */
    public com.google.protobuf.ByteString getMachineTypeBytes() {
      java.lang.Object ref = machineType_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        machineType_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. The server type.
     * [Available server
     * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations)
     * </pre>
     *
     * <code>string machine_type = 4 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param value The machineType to set.
     * @return This builder for chaining.
     */
    public Builder setMachineType(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      machineType_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. The server type.
     * [Available server
     * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations)
     * </pre>
     *
     * <code>string machine_type = 4 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearMachineType() {
      machineType_ = getDefaultInstance().getMachineType();
      bitField0_ = (bitField0_ & ~0x00000010);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. The server type.
     * [Available server
     * types](https://cloud.google.com/bare-metal/docs/bms-planning#server_configurations)
     * </pre>
     *
     * <code>string machine_type = 4 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param value The bytes for machineType to set.
     * @return This builder for chaining.
     */
    public Builder setMachineTypeBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      machineType_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }

    private int state_ = 0;
    /**
     *
     *
     * <pre>
     * Output only. The state of the server.
     * </pre>
     *
     * <code>
     * .google.cloud.baremetalsolution.v2.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The enum numeric value on the wire for state.
     */
    @java.lang.Override
    public int getStateValue() {
      return state_;
    }
    /**
     *
     *
     * <pre>
     * Output only. The state of the server.
     * </pre>
     *
     * <code>
     * .google.cloud.baremetalsolution.v2.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param value The enum numeric value on the wire for state to set.
     * @return This builder for chaining.
     */
    public Builder setStateValue(int value) {
      state_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The state of the server.
     * </pre>
     *
     * <code>
     * .google.cloud.baremetalsolution.v2.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The state.
     */
    @java.lang.Override
    public com.google.cloud.baremetalsolution.v2.Instance.State getState() {
      com.google.cloud.baremetalsolution.v2.Instance.State result =
          com.google.cloud.baremetalsolution.v2.Instance.State.forNumber(state_);
      return result == null
          ? com.google.cloud.baremetalsolution.v2.Instance.State.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * Output only. The state of the server.
     * </pre>
     *
     * <code>
     * .google.cloud.baremetalsolution.v2.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param value The state to set.
     * @return This builder for chaining.
     */
    public Builder setState(com.google.cloud.baremetalsolution.v2.Instance.State value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000020;
      state_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The state of the server.
     * </pre>
     *
     * <code>
     * .google.cloud.baremetalsolution.v2.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearState() {
      bitField0_ = (bitField0_ & ~0x00000020);
      state_ = 0;
      onChanged();
      return this;
    }

    private boolean hyperthreadingEnabled_;
    /**
     *
     *
     * <pre>
     * True if you enable hyperthreading for the server, otherwise false.
     * The default value is false.
     * </pre>
     *
     * <code>bool hyperthreading_enabled = 6;</code>
     *
     * @return The hyperthreadingEnabled.
     */
    @java.lang.Override
    public boolean getHyperthreadingEnabled() {
      return hyperthreadingEnabled_;
    }
    /**
     *
     *
     * <pre>
     * True if you enable hyperthreading for the server, otherwise false.
     * The default value is false.
     * </pre>
     *
     * <code>bool hyperthreading_enabled = 6;</code>
     *
     * @param value The hyperthreadingEnabled to set.
     * @return This builder for chaining.
     */
    public Builder setHyperthreadingEnabled(boolean value) {

      hyperthreadingEnabled_ = value;
      bitField0_ |= 0x00000040;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * True if you enable hyperthreading for the server, otherwise false.
     * The default value is false.
     * </pre>
     *
     * <code>bool hyperthreading_enabled = 6;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearHyperthreadingEnabled() {
      bitField0_ = (bitField0_ & ~0x00000040);
      hyperthreadingEnabled_ = false;
      onChanged();
      return this;
    }

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

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
      if (labels_ == null) {
        return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
      }
      return labels_;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetMutableLabels() {
      if (labels_ == null) {
        labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry);
      }
      if (!labels_.isMutable()) {
        labels_ = labels_.copy();
      }
      bitField0_ |= 0x00000080;
      onChanged();
      return labels_;
    }

    public int getLabelsCount() {
      return internalGetLabels().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * Labels as key value pairs.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 7;</code>
     */
    @java.lang.Override
    public boolean containsLabels(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      return internalGetLabels().getMap().containsKey(key);
    }
    /** Use {@link #getLabelsMap()} instead. */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getLabels() {
      return getLabelsMap();
    }
    /**
     *
     *
     * <pre>
     * Labels as key value pairs.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 7;</code>
     */
    @java.lang.Override
    public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
      return internalGetLabels().getMap();
    }
    /**
     *
     *
     * <pre>
     * Labels as key value pairs.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 7;</code>
     */
    @java.lang.Override
    public /* nullable */ java.lang.String getLabelsOrDefault(
        java.lang.String key,
        /* nullable */
        java.lang.String defaultValue) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * Labels as key value pairs.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 7;</code>
     */
    @java.lang.Override
    public java.lang.String getLabelsOrThrow(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearLabels() {
      bitField0_ = (bitField0_ & ~0x00000080);
      internalGetMutableLabels().getMutableMap().clear();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Labels as key value pairs.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 7;</code>
     */
    public Builder removeLabels(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      internalGetMutableLabels().getMutableMap().remove(key);
      return this;
    }
    /** Use alternate mutation accessors instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getMutableLabels() {
      bitField0_ |= 0x00000080;
      return internalGetMutableLabels().getMutableMap();
    }
    /**
     *
     *
     * <pre>
     * Labels as key value pairs.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 7;</code>
     */
    public Builder putLabels(java.lang.String key, java.lang.String value) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      if (value == null) {
        throw new NullPointerException("map value");
      }
      internalGetMutableLabels().getMutableMap().put(key, value);
      bitField0_ |= 0x00000080;
      return this;
    }
    /**
     *
     *
     * <pre>
     * Labels as key value pairs.
     * </pre>
     *
     * <code>map&lt;string, string&gt; labels = 7;</code>
     */
    public Builder putAllLabels(java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableLabels().getMutableMap().putAll(values);
      bitField0_ |= 0x00000080;
      return this;
    }

    private java.util.List<com.google.cloud.baremetalsolution.v2.Lun> luns_ =
        java.util.Collections.emptyList();

    private void ensureLunsIsMutable() {
      if (!((bitField0_ & 0x00000100) != 0)) {
        luns_ = new java.util.ArrayList<com.google.cloud.baremetalsolution.v2.Lun>(luns_);
        bitField0_ |= 0x00000100;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.baremetalsolution.v2.Lun,
            com.google.cloud.baremetalsolution.v2.Lun.Builder,
            com.google.cloud.baremetalsolution.v2.LunOrBuilder>
        lunsBuilder_;

    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public java.util.List<com.google.cloud.baremetalsolution.v2.Lun> getLunsList() {
      if (lunsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(luns_);
      } else {
        return lunsBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public int getLunsCount() {
      if (lunsBuilder_ == null) {
        return luns_.size();
      } else {
        return lunsBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.Lun getLuns(int index) {
      if (lunsBuilder_ == null) {
        return luns_.get(index);
      } else {
        return lunsBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder setLuns(int index, com.google.cloud.baremetalsolution.v2.Lun value) {
      if (lunsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureLunsIsMutable();
        luns_.set(index, value);
        onChanged();
      } else {
        lunsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder setLuns(
        int index, com.google.cloud.baremetalsolution.v2.Lun.Builder builderForValue) {
      if (lunsBuilder_ == null) {
        ensureLunsIsMutable();
        luns_.set(index, builderForValue.build());
        onChanged();
      } else {
        lunsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder addLuns(com.google.cloud.baremetalsolution.v2.Lun value) {
      if (lunsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureLunsIsMutable();
        luns_.add(value);
        onChanged();
      } else {
        lunsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder addLuns(int index, com.google.cloud.baremetalsolution.v2.Lun value) {
      if (lunsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureLunsIsMutable();
        luns_.add(index, value);
        onChanged();
      } else {
        lunsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder addLuns(com.google.cloud.baremetalsolution.v2.Lun.Builder builderForValue) {
      if (lunsBuilder_ == null) {
        ensureLunsIsMutable();
        luns_.add(builderForValue.build());
        onChanged();
      } else {
        lunsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder addLuns(
        int index, com.google.cloud.baremetalsolution.v2.Lun.Builder builderForValue) {
      if (lunsBuilder_ == null) {
        ensureLunsIsMutable();
        luns_.add(index, builderForValue.build());
        onChanged();
      } else {
        lunsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder addAllLuns(
        java.lang.Iterable<? extends com.google.cloud.baremetalsolution.v2.Lun> values) {
      if (lunsBuilder_ == null) {
        ensureLunsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, luns_);
        onChanged();
      } else {
        lunsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder clearLuns() {
      if (lunsBuilder_ == null) {
        luns_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000100);
        onChanged();
      } else {
        lunsBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public Builder removeLuns(int index) {
      if (lunsBuilder_ == null) {
        ensureLunsIsMutable();
        luns_.remove(index);
        onChanged();
      } else {
        lunsBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.Lun.Builder getLunsBuilder(int index) {
      return getLunsFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.LunOrBuilder getLunsOrBuilder(int index) {
      if (lunsBuilder_ == null) {
        return luns_.get(index);
      } else {
        return lunsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public java.util.List<? extends com.google.cloud.baremetalsolution.v2.LunOrBuilder>
        getLunsOrBuilderList() {
      if (lunsBuilder_ != null) {
        return lunsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(luns_);
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.Lun.Builder addLunsBuilder() {
      return getLunsFieldBuilder()
          .addBuilder(com.google.cloud.baremetalsolution.v2.Lun.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.Lun.Builder addLunsBuilder(int index) {
      return getLunsFieldBuilder()
          .addBuilder(index, com.google.cloud.baremetalsolution.v2.Lun.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Immutable. List of LUNs associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Lun luns = 8 [(.google.api.field_behavior) = IMMUTABLE];
     * </code>
     */
    public java.util.List<com.google.cloud.baremetalsolution.v2.Lun.Builder> getLunsBuilderList() {
      return getLunsFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.baremetalsolution.v2.Lun,
            com.google.cloud.baremetalsolution.v2.Lun.Builder,
            com.google.cloud.baremetalsolution.v2.LunOrBuilder>
        getLunsFieldBuilder() {
      if (lunsBuilder_ == null) {
        lunsBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.baremetalsolution.v2.Lun,
                com.google.cloud.baremetalsolution.v2.Lun.Builder,
                com.google.cloud.baremetalsolution.v2.LunOrBuilder>(
                luns_, ((bitField0_ & 0x00000100) != 0), getParentForChildren(), isClean());
        luns_ = null;
      }
      return lunsBuilder_;
    }

    private java.util.List<com.google.cloud.baremetalsolution.v2.Volume> volumes_ =
        java.util.Collections.emptyList();

    private void ensureVolumesIsMutable() {
      if (!((bitField0_ & 0x00000200) != 0)) {
        volumes_ = new java.util.ArrayList<com.google.cloud.baremetalsolution.v2.Volume>(volumes_);
        bitField0_ |= 0x00000200;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.baremetalsolution.v2.Volume,
            com.google.cloud.baremetalsolution.v2.Volume.Builder,
            com.google.cloud.baremetalsolution.v2.VolumeOrBuilder>
        volumesBuilder_;

    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public java.util.List<com.google.cloud.baremetalsolution.v2.Volume> getVolumesList() {
      if (volumesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(volumes_);
      } else {
        return volumesBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public int getVolumesCount() {
      if (volumesBuilder_ == null) {
        return volumes_.size();
      } else {
        return volumesBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.Volume getVolumes(int index) {
      if (volumesBuilder_ == null) {
        return volumes_.get(index);
      } else {
        return volumesBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public Builder setVolumes(int index, com.google.cloud.baremetalsolution.v2.Volume value) {
      if (volumesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureVolumesIsMutable();
        volumes_.set(index, value);
        onChanged();
      } else {
        volumesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public Builder setVolumes(
        int index, com.google.cloud.baremetalsolution.v2.Volume.Builder builderForValue) {
      if (volumesBuilder_ == null) {
        ensureVolumesIsMutable();
        volumes_.set(index, builderForValue.build());
        onChanged();
      } else {
        volumesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public Builder addVolumes(com.google.cloud.baremetalsolution.v2.Volume value) {
      if (volumesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureVolumesIsMutable();
        volumes_.add(value);
        onChanged();
      } else {
        volumesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public Builder addVolumes(int index, com.google.cloud.baremetalsolution.v2.Volume value) {
      if (volumesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureVolumesIsMutable();
        volumes_.add(index, value);
        onChanged();
      } else {
        volumesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public Builder addVolumes(
        com.google.cloud.baremetalsolution.v2.Volume.Builder builderForValue) {
      if (volumesBuilder_ == null) {
        ensureVolumesIsMutable();
        volumes_.add(builderForValue.build());
        onChanged();
      } else {
        volumesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public Builder addVolumes(
        int index, com.google.cloud.baremetalsolution.v2.Volume.Builder builderForValue) {
      if (volumesBuilder_ == null) {
        ensureVolumesIsMutable();
        volumes_.add(index, builderForValue.build());
        onChanged();
      } else {
        volumesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public Builder addAllVolumes(
        java.lang.Iterable<? extends com.google.cloud.baremetalsolution.v2.Volume> values) {
      if (volumesBuilder_ == null) {
        ensureVolumesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, volumes_);
        onChanged();
      } else {
        volumesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public Builder clearVolumes() {
      if (volumesBuilder_ == null) {
        volumes_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000200);
        onChanged();
      } else {
        volumesBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public Builder removeVolumes(int index) {
      if (volumesBuilder_ == null) {
        ensureVolumesIsMutable();
        volumes_.remove(index);
        onChanged();
      } else {
        volumesBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.Volume.Builder getVolumesBuilder(int index) {
      return getVolumesFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.VolumeOrBuilder getVolumesOrBuilder(int index) {
      if (volumesBuilder_ == null) {
        return volumes_.get(index);
      } else {
        return volumesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public java.util.List<? extends com.google.cloud.baremetalsolution.v2.VolumeOrBuilder>
        getVolumesOrBuilderList() {
      if (volumesBuilder_ != null) {
        return volumesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(volumes_);
      }
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.Volume.Builder addVolumesBuilder() {
      return getVolumesFieldBuilder()
          .addBuilder(com.google.cloud.baremetalsolution.v2.Volume.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.Volume.Builder addVolumesBuilder(int index) {
      return getVolumesFieldBuilder()
          .addBuilder(index, com.google.cloud.baremetalsolution.v2.Volume.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Input only. List of Volumes to attach to this Instance on creation.
     * This field won't be populated in Get/List responses.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Volume volumes = 16 [(.google.api.field_behavior) = INPUT_ONLY];
     * </code>
     */
    public java.util.List<com.google.cloud.baremetalsolution.v2.Volume.Builder>
        getVolumesBuilderList() {
      return getVolumesFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.baremetalsolution.v2.Volume,
            com.google.cloud.baremetalsolution.v2.Volume.Builder,
            com.google.cloud.baremetalsolution.v2.VolumeOrBuilder>
        getVolumesFieldBuilder() {
      if (volumesBuilder_ == null) {
        volumesBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.baremetalsolution.v2.Volume,
                com.google.cloud.baremetalsolution.v2.Volume.Builder,
                com.google.cloud.baremetalsolution.v2.VolumeOrBuilder>(
                volumes_, ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean());
        volumes_ = null;
      }
      return volumesBuilder_;
    }

    private java.util.List<com.google.cloud.baremetalsolution.v2.Network> networks_ =
        java.util.Collections.emptyList();

    private void ensureNetworksIsMutable() {
      if (!((bitField0_ & 0x00000400) != 0)) {
        networks_ =
            new java.util.ArrayList<com.google.cloud.baremetalsolution.v2.Network>(networks_);
        bitField0_ |= 0x00000400;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.baremetalsolution.v2.Network,
            com.google.cloud.baremetalsolution.v2.Network.Builder,
            com.google.cloud.baremetalsolution.v2.NetworkOrBuilder>
        networksBuilder_;

    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public java.util.List<com.google.cloud.baremetalsolution.v2.Network> getNetworksList() {
      if (networksBuilder_ == null) {
        return java.util.Collections.unmodifiableList(networks_);
      } else {
        return networksBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public int getNetworksCount() {
      if (networksBuilder_ == null) {
        return networks_.size();
      } else {
        return networksBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.Network getNetworks(int index) {
      if (networksBuilder_ == null) {
        return networks_.get(index);
      } else {
        return networksBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setNetworks(int index, com.google.cloud.baremetalsolution.v2.Network value) {
      if (networksBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureNetworksIsMutable();
        networks_.set(index, value);
        onChanged();
      } else {
        networksBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder setNetworks(
        int index, com.google.cloud.baremetalsolution.v2.Network.Builder builderForValue) {
      if (networksBuilder_ == null) {
        ensureNetworksIsMutable();
        networks_.set(index, builderForValue.build());
        onChanged();
      } else {
        networksBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder addNetworks(com.google.cloud.baremetalsolution.v2.Network value) {
      if (networksBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureNetworksIsMutable();
        networks_.add(value);
        onChanged();
      } else {
        networksBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder addNetworks(int index, com.google.cloud.baremetalsolution.v2.Network value) {
      if (networksBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureNetworksIsMutable();
        networks_.add(index, value);
        onChanged();
      } else {
        networksBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder addNetworks(
        com.google.cloud.baremetalsolution.v2.Network.Builder builderForValue) {
      if (networksBuilder_ == null) {
        ensureNetworksIsMutable();
        networks_.add(builderForValue.build());
        onChanged();
      } else {
        networksBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder addNetworks(
        int index, com.google.cloud.baremetalsolution.v2.Network.Builder builderForValue) {
      if (networksBuilder_ == null) {
        ensureNetworksIsMutable();
        networks_.add(index, builderForValue.build());
        onChanged();
      } else {
        networksBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder addAllNetworks(
        java.lang.Iterable<? extends com.google.cloud.baremetalsolution.v2.Network> values) {
      if (networksBuilder_ == null) {
        ensureNetworksIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, networks_);
        onChanged();
      } else {
        networksBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder clearNetworks() {
      if (networksBuilder_ == null) {
        networks_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000400);
        onChanged();
      } else {
        networksBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public Builder removeNetworks(int index) {
      if (networksBuilder_ == null) {
        ensureNetworksIsMutable();
        networks_.remove(index);
        onChanged();
      } else {
        networksBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.Network.Builder getNetworksBuilder(int index) {
      return getNetworksFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.NetworkOrBuilder getNetworksOrBuilder(int index) {
      if (networksBuilder_ == null) {
        return networks_.get(index);
      } else {
        return networksBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public java.util.List<? extends com.google.cloud.baremetalsolution.v2.NetworkOrBuilder>
        getNetworksOrBuilderList() {
      if (networksBuilder_ != null) {
        return networksBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(networks_);
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.Network.Builder addNetworksBuilder() {
      return getNetworksFieldBuilder()
          .addBuilder(com.google.cloud.baremetalsolution.v2.Network.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.Network.Builder addNetworksBuilder(int index) {
      return getNetworksFieldBuilder()
          .addBuilder(index, com.google.cloud.baremetalsolution.v2.Network.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Output only. List of networks associated with this server.
     * </pre>
     *
     * <code>
     * repeated .google.cloud.baremetalsolution.v2.Network networks = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     */
    public java.util.List<com.google.cloud.baremetalsolution.v2.Network.Builder>
        getNetworksBuilderList() {
      return getNetworksFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.baremetalsolution.v2.Network,
            com.google.cloud.baremetalsolution.v2.Network.Builder,
            com.google.cloud.baremetalsolution.v2.NetworkOrBuilder>
        getNetworksFieldBuilder() {
      if (networksBuilder_ == null) {
        networksBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.baremetalsolution.v2.Network,
                com.google.cloud.baremetalsolution.v2.Network.Builder,
                com.google.cloud.baremetalsolution.v2.NetworkOrBuilder>(
                networks_, ((bitField0_ & 0x00000400) != 0), getParentForChildren(), isClean());
        networks_ = null;
      }
      return networksBuilder_;
    }

    private boolean interactiveSerialConsoleEnabled_;
    /**
     *
     *
     * <pre>
     * Output only. True if the interactive serial console feature is enabled for
     * the instance, false otherwise. The default value is false.
     * </pre>
     *
     * <code>
     * bool interactive_serial_console_enabled = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return The interactiveSerialConsoleEnabled.
     */
    @java.lang.Override
    public boolean getInteractiveSerialConsoleEnabled() {
      return interactiveSerialConsoleEnabled_;
    }
    /**
     *
     *
     * <pre>
     * Output only. True if the interactive serial console feature is enabled for
     * the instance, false otherwise. The default value is false.
     * </pre>
     *
     * <code>
     * bool interactive_serial_console_enabled = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @param value The interactiveSerialConsoleEnabled to set.
     * @return This builder for chaining.
     */
    public Builder setInteractiveSerialConsoleEnabled(boolean value) {

      interactiveSerialConsoleEnabled_ = value;
      bitField0_ |= 0x00000800;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. True if the interactive serial console feature is enabled for
     * the instance, false otherwise. The default value is false.
     * </pre>
     *
     * <code>
     * bool interactive_serial_console_enabled = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearInteractiveSerialConsoleEnabled() {
      bitField0_ = (bitField0_ & ~0x00000800);
      interactiveSerialConsoleEnabled_ = false;
      onChanged();
      return this;
    }

    private java.lang.Object osImage_ = "";
    /**
     *
     *
     * <pre>
     * The OS image currently installed on the server.
     * </pre>
     *
     * <code>string os_image = 12;</code>
     *
     * @return The osImage.
     */
    public java.lang.String getOsImage() {
      java.lang.Object ref = osImage_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        osImage_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The OS image currently installed on the server.
     * </pre>
     *
     * <code>string os_image = 12;</code>
     *
     * @return The bytes for osImage.
     */
    public com.google.protobuf.ByteString getOsImageBytes() {
      java.lang.Object ref = osImage_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        osImage_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The OS image currently installed on the server.
     * </pre>
     *
     * <code>string os_image = 12;</code>
     *
     * @param value The osImage to set.
     * @return This builder for chaining.
     */
    public Builder setOsImage(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      osImage_ = value;
      bitField0_ |= 0x00001000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The OS image currently installed on the server.
     * </pre>
     *
     * <code>string os_image = 12;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearOsImage() {
      osImage_ = getDefaultInstance().getOsImage();
      bitField0_ = (bitField0_ & ~0x00001000);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The OS image currently installed on the server.
     * </pre>
     *
     * <code>string os_image = 12;</code>
     *
     * @param value The bytes for osImage to set.
     * @return This builder for chaining.
     */
    public Builder setOsImageBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      osImage_ = value;
      bitField0_ |= 0x00001000;
      onChanged();
      return this;
    }

    private java.lang.Object pod_ = "";
    /**
     *
     *
     * <pre>
     * Immutable. Pod name.
     * Pod is an independent part of infrastructure.
     * Instance can be connected to the assets (networks, volumes) allocated
     * in the same pod only.
     * </pre>
     *
     * <code>string pod = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return The pod.
     */
    public java.lang.String getPod() {
      java.lang.Object ref = pod_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        pod_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. Pod name.
     * Pod is an independent part of infrastructure.
     * Instance can be connected to the assets (networks, volumes) allocated
     * in the same pod only.
     * </pre>
     *
     * <code>string pod = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return The bytes for pod.
     */
    public com.google.protobuf.ByteString getPodBytes() {
      java.lang.Object ref = pod_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        pod_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Immutable. Pod name.
     * Pod is an independent part of infrastructure.
     * Instance can be connected to the assets (networks, volumes) allocated
     * in the same pod only.
     * </pre>
     *
     * <code>string pod = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param value The pod to set.
     * @return This builder for chaining.
     */
    public Builder setPod(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      pod_ = value;
      bitField0_ |= 0x00002000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. Pod name.
     * Pod is an independent part of infrastructure.
     * Instance can be connected to the assets (networks, volumes) allocated
     * in the same pod only.
     * </pre>
     *
     * <code>string pod = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPod() {
      pod_ = getDefaultInstance().getPod();
      bitField0_ = (bitField0_ & ~0x00002000);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Immutable. Pod name.
     * Pod is an independent part of infrastructure.
     * Instance can be connected to the assets (networks, volumes) allocated
     * in the same pod only.
     * </pre>
     *
     * <code>string pod = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param value The bytes for pod to set.
     * @return This builder for chaining.
     */
    public Builder setPodBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      pod_ = value;
      bitField0_ |= 0x00002000;
      onChanged();
      return this;
    }

    private java.lang.Object networkTemplate_ = "";
    /**
     *
     *
     * <pre>
     * Instance network template name. For eg, bondaa-bondaa, bondab-nic, etc.
     * Generally, the template name follows the syntax of
     * "bond&lt;bond_mode&gt;" or "nic".
     * </pre>
     *
     * <code>string network_template = 14 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The networkTemplate.
     */
    public java.lang.String getNetworkTemplate() {
      java.lang.Object ref = networkTemplate_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        networkTemplate_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Instance network template name. For eg, bondaa-bondaa, bondab-nic, etc.
     * Generally, the template name follows the syntax of
     * "bond&lt;bond_mode&gt;" or "nic".
     * </pre>
     *
     * <code>string network_template = 14 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The bytes for networkTemplate.
     */
    public com.google.protobuf.ByteString getNetworkTemplateBytes() {
      java.lang.Object ref = networkTemplate_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        networkTemplate_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Instance network template name. For eg, bondaa-bondaa, bondab-nic, etc.
     * Generally, the template name follows the syntax of
     * "bond&lt;bond_mode&gt;" or "nic".
     * </pre>
     *
     * <code>string network_template = 14 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The networkTemplate to set.
     * @return This builder for chaining.
     */
    public Builder setNetworkTemplate(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      networkTemplate_ = value;
      bitField0_ |= 0x00004000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Instance network template name. For eg, bondaa-bondaa, bondab-nic, etc.
     * Generally, the template name follows the syntax of
     * "bond&lt;bond_mode&gt;" or "nic".
     * </pre>
     *
     * <code>string network_template = 14 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearNetworkTemplate() {
      networkTemplate_ = getDefaultInstance().getNetworkTemplate();
      bitField0_ = (bitField0_ & ~0x00004000);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Instance network template name. For eg, bondaa-bondaa, bondab-nic, etc.
     * Generally, the template name follows the syntax of
     * "bond&lt;bond_mode&gt;" or "nic".
     * </pre>
     *
     * <code>string network_template = 14 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The bytes for networkTemplate to set.
     * @return This builder for chaining.
     */
    public Builder setNetworkTemplateBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      networkTemplate_ = value;
      bitField0_ |= 0x00004000;
      onChanged();
      return this;
    }

    private java.util.List<com.google.cloud.baremetalsolution.v2.LogicalInterface>
        logicalInterfaces_ = java.util.Collections.emptyList();

    private void ensureLogicalInterfacesIsMutable() {
      if (!((bitField0_ & 0x00008000) != 0)) {
        logicalInterfaces_ =
            new java.util.ArrayList<com.google.cloud.baremetalsolution.v2.LogicalInterface>(
                logicalInterfaces_);
        bitField0_ |= 0x00008000;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.baremetalsolution.v2.LogicalInterface,
            com.google.cloud.baremetalsolution.v2.LogicalInterface.Builder,
            com.google.cloud.baremetalsolution.v2.LogicalInterfaceOrBuilder>
        logicalInterfacesBuilder_;

    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public java.util.List<com.google.cloud.baremetalsolution.v2.LogicalInterface>
        getLogicalInterfacesList() {
      if (logicalInterfacesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(logicalInterfaces_);
      } else {
        return logicalInterfacesBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public int getLogicalInterfacesCount() {
      if (logicalInterfacesBuilder_ == null) {
        return logicalInterfaces_.size();
      } else {
        return logicalInterfacesBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.LogicalInterface getLogicalInterfaces(int index) {
      if (logicalInterfacesBuilder_ == null) {
        return logicalInterfaces_.get(index);
      } else {
        return logicalInterfacesBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public Builder setLogicalInterfaces(
        int index, com.google.cloud.baremetalsolution.v2.LogicalInterface value) {
      if (logicalInterfacesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureLogicalInterfacesIsMutable();
        logicalInterfaces_.set(index, value);
        onChanged();
      } else {
        logicalInterfacesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public Builder setLogicalInterfaces(
        int index, com.google.cloud.baremetalsolution.v2.LogicalInterface.Builder builderForValue) {
      if (logicalInterfacesBuilder_ == null) {
        ensureLogicalInterfacesIsMutable();
        logicalInterfaces_.set(index, builderForValue.build());
        onChanged();
      } else {
        logicalInterfacesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public Builder addLogicalInterfaces(
        com.google.cloud.baremetalsolution.v2.LogicalInterface value) {
      if (logicalInterfacesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureLogicalInterfacesIsMutable();
        logicalInterfaces_.add(value);
        onChanged();
      } else {
        logicalInterfacesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public Builder addLogicalInterfaces(
        int index, com.google.cloud.baremetalsolution.v2.LogicalInterface value) {
      if (logicalInterfacesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureLogicalInterfacesIsMutable();
        logicalInterfaces_.add(index, value);
        onChanged();
      } else {
        logicalInterfacesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public Builder addLogicalInterfaces(
        com.google.cloud.baremetalsolution.v2.LogicalInterface.Builder builderForValue) {
      if (logicalInterfacesBuilder_ == null) {
        ensureLogicalInterfacesIsMutable();
        logicalInterfaces_.add(builderForValue.build());
        onChanged();
      } else {
        logicalInterfacesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public Builder addLogicalInterfaces(
        int index, com.google.cloud.baremetalsolution.v2.LogicalInterface.Builder builderForValue) {
      if (logicalInterfacesBuilder_ == null) {
        ensureLogicalInterfacesIsMutable();
        logicalInterfaces_.add(index, builderForValue.build());
        onChanged();
      } else {
        logicalInterfacesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public Builder addAllLogicalInterfaces(
        java.lang.Iterable<? extends com.google.cloud.baremetalsolution.v2.LogicalInterface>
            values) {
      if (logicalInterfacesBuilder_ == null) {
        ensureLogicalInterfacesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, logicalInterfaces_);
        onChanged();
      } else {
        logicalInterfacesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public Builder clearLogicalInterfaces() {
      if (logicalInterfacesBuilder_ == null) {
        logicalInterfaces_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00008000);
        onChanged();
      } else {
        logicalInterfacesBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public Builder removeLogicalInterfaces(int index) {
      if (logicalInterfacesBuilder_ == null) {
        ensureLogicalInterfacesIsMutable();
        logicalInterfaces_.remove(index);
        onChanged();
      } else {
        logicalInterfacesBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.LogicalInterface.Builder
        getLogicalInterfacesBuilder(int index) {
      return getLogicalInterfacesFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.LogicalInterfaceOrBuilder
        getLogicalInterfacesOrBuilder(int index) {
      if (logicalInterfacesBuilder_ == null) {
        return logicalInterfaces_.get(index);
      } else {
        return logicalInterfacesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public java.util.List<? extends com.google.cloud.baremetalsolution.v2.LogicalInterfaceOrBuilder>
        getLogicalInterfacesOrBuilderList() {
      if (logicalInterfacesBuilder_ != null) {
        return logicalInterfacesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(logicalInterfaces_);
      }
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.LogicalInterface.Builder
        addLogicalInterfacesBuilder() {
      return getLogicalInterfacesFieldBuilder()
          .addBuilder(com.google.cloud.baremetalsolution.v2.LogicalInterface.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public com.google.cloud.baremetalsolution.v2.LogicalInterface.Builder
        addLogicalInterfacesBuilder(int index) {
      return getLogicalInterfacesFieldBuilder()
          .addBuilder(
              index, com.google.cloud.baremetalsolution.v2.LogicalInterface.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * List of logical interfaces for the instance. The number of logical
     * interfaces will be the same as number of hardware bond/nic on the chosen
     * network template. For the non-multivlan configurations (for eg, existing
     * servers) that use existing default network template (bondaa-bondaa), both
     * the Instance.networks field and the Instance.logical_interfaces fields will
     * be filled to ensure backward compatibility. For the others, only
     * Instance.logical_interfaces will be filled.
     * </pre>
     *
     * <code>repeated .google.cloud.baremetalsolution.v2.LogicalInterface logical_interfaces = 15;
     * </code>
     */
    public java.util.List<com.google.cloud.baremetalsolution.v2.LogicalInterface.Builder>
        getLogicalInterfacesBuilderList() {
      return getLogicalInterfacesFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.baremetalsolution.v2.LogicalInterface,
            com.google.cloud.baremetalsolution.v2.LogicalInterface.Builder,
            com.google.cloud.baremetalsolution.v2.LogicalInterfaceOrBuilder>
        getLogicalInterfacesFieldBuilder() {
      if (logicalInterfacesBuilder_ == null) {
        logicalInterfacesBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.baremetalsolution.v2.LogicalInterface,
                com.google.cloud.baremetalsolution.v2.LogicalInterface.Builder,
                com.google.cloud.baremetalsolution.v2.LogicalInterfaceOrBuilder>(
                logicalInterfaces_,
                ((bitField0_ & 0x00008000) != 0),
                getParentForChildren(),
                isClean());
        logicalInterfaces_ = null;
      }
      return logicalInterfacesBuilder_;
    }

    private java.lang.Object loginInfo_ = "";
    /**
     *
     *
     * <pre>
     * Output only. Text field about info for logging in.
     * </pre>
     *
     * <code>string login_info = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The loginInfo.
     */
    public java.lang.String getLoginInfo() {
      java.lang.Object ref = loginInfo_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        loginInfo_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Text field about info for logging in.
     * </pre>
     *
     * <code>string login_info = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The bytes for loginInfo.
     */
    public com.google.protobuf.ByteString getLoginInfoBytes() {
      java.lang.Object ref = loginInfo_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        loginInfo_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. Text field about info for logging in.
     * </pre>
     *
     * <code>string login_info = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The loginInfo to set.
     * @return This builder for chaining.
     */
    public Builder setLoginInfo(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      loginInfo_ = value;
      bitField0_ |= 0x00010000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Text field about info for logging in.
     * </pre>
     *
     * <code>string login_info = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearLoginInfo() {
      loginInfo_ = getDefaultInstance().getLoginInfo();
      bitField0_ = (bitField0_ & ~0x00010000);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. Text field about info for logging in.
     * </pre>
     *
     * <code>string login_info = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The bytes for loginInfo to set.
     * @return This builder for chaining.
     */
    public Builder setLoginInfoBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      loginInfo_ = value;
      bitField0_ |= 0x00010000;
      onChanged();
      return this;
    }

    private int workloadProfile_ = 0;
    /**
     *
     *
     * <pre>
     * The workload profile for the instance.
     * </pre>
     *
     * <code>.google.cloud.baremetalsolution.v2.WorkloadProfile workload_profile = 18;</code>
     *
     * @return The enum numeric value on the wire for workloadProfile.
     */
    @java.lang.Override
    public int getWorkloadProfileValue() {
      return workloadProfile_;
    }
    /**
     *
     *
     * <pre>
     * The workload profile for the instance.
     * </pre>
     *
     * <code>.google.cloud.baremetalsolution.v2.WorkloadProfile workload_profile = 18;</code>
     *
     * @param value The enum numeric value on the wire for workloadProfile to set.
     * @return This builder for chaining.
     */
    public Builder setWorkloadProfileValue(int value) {
      workloadProfile_ = value;
      bitField0_ |= 0x00020000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The workload profile for the instance.
     * </pre>
     *
     * <code>.google.cloud.baremetalsolution.v2.WorkloadProfile workload_profile = 18;</code>
     *
     * @return The workloadProfile.
     */
    @java.lang.Override
    public com.google.cloud.baremetalsolution.v2.WorkloadProfile getWorkloadProfile() {
      com.google.cloud.baremetalsolution.v2.WorkloadProfile result =
          com.google.cloud.baremetalsolution.v2.WorkloadProfile.forNumber(workloadProfile_);
      return result == null
          ? com.google.cloud.baremetalsolution.v2.WorkloadProfile.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * The workload profile for the instance.
     * </pre>
     *
     * <code>.google.cloud.baremetalsolution.v2.WorkloadProfile workload_profile = 18;</code>
     *
     * @param value The workloadProfile to set.
     * @return This builder for chaining.
     */
    public Builder setWorkloadProfile(com.google.cloud.baremetalsolution.v2.WorkloadProfile value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00020000;
      workloadProfile_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The workload profile for the instance.
     * </pre>
     *
     * <code>.google.cloud.baremetalsolution.v2.WorkloadProfile workload_profile = 18;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearWorkloadProfile() {
      bitField0_ = (bitField0_ & ~0x00020000);
      workloadProfile_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object firmwareVersion_ = "";
    /**
     *
     *
     * <pre>
     * Output only. The firmware version for the instance.
     * </pre>
     *
     * <code>string firmware_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The firmwareVersion.
     */
    public java.lang.String getFirmwareVersion() {
      java.lang.Object ref = firmwareVersion_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        firmwareVersion_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The firmware version for the instance.
     * </pre>
     *
     * <code>string firmware_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return The bytes for firmwareVersion.
     */
    public com.google.protobuf.ByteString getFirmwareVersionBytes() {
      java.lang.Object ref = firmwareVersion_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        firmwareVersion_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Output only. The firmware version for the instance.
     * </pre>
     *
     * <code>string firmware_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The firmwareVersion to set.
     * @return This builder for chaining.
     */
    public Builder setFirmwareVersion(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      firmwareVersion_ = value;
      bitField0_ |= 0x00040000;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The firmware version for the instance.
     * </pre>
     *
     * <code>string firmware_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearFirmwareVersion() {
      firmwareVersion_ = getDefaultInstance().getFirmwareVersion();
      bitField0_ = (bitField0_ & ~0x00040000);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Output only. The firmware version for the instance.
     * </pre>
     *
     * <code>string firmware_version = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param value The bytes for firmwareVersion to set.
     * @return This builder for chaining.
     */
    public Builder setFirmwareVersionBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      firmwareVersion_ = value;
      bitField0_ |= 0x00040000;
      onChanged();
      return this;
    }

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

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

    // @@protoc_insertion_point(builder_scope:google.cloud.baremetalsolution.v2.Instance)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.baremetalsolution.v2.Instance)
  private static final com.google.cloud.baremetalsolution.v2.Instance DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.baremetalsolution.v2.Instance();
  }

  public static com.google.cloud.baremetalsolution.v2.Instance getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<Instance> PARSER =
      new com.google.protobuf.AbstractParser<Instance>() {
        @java.lang.Override
        public Instance parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

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

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

  @java.lang.Override
  public com.google.cloud.baremetalsolution.v2.Instance getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
