@java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (((bitField0_ & 0x00000001) != 0)) {
      output.writeMessage(1, getMachineSpec());
    }
    if (minReplicaCount_ != 0) {
      output.writeInt32(2, minReplicaCount_);
    }
    if (maxReplicaCount_ != 0) {
      output.writeInt32(3, maxReplicaCount_);
    }
    for (int i = 0; i < autoscalingMetricSpecs_.size(); i++) {
      output.writeMessage(4, autoscalingMetricSpecs_.get(i));
    }
    if (spot_ != false) {
      output.writeBool(5, spot_);
    }
    if (requiredReplicaCount_ != 0) {
      output.writeInt32(9, requiredReplicaCount_);
    }
    getUnknownFields().writeTo(output);
  }
<pre>
Optional. If true, schedule the deployment workload on [spot
VMs](https://cloud.google.com/kubernetes-engine/docs/concepts/spot-vms).
</pre>

<code>bool spot = 5 [(.google.api.field_behavior) = OPTIONAL];</code>

@return The spot.
java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/DedicatedResources.java