/*
 * Copyright 2020 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/dataflow/v1beta3/messages.proto

package com.google.dataflow.v1beta3;

/**
 *
 *
 * <pre>
 * A structured message reporting an autoscaling decision made by the Dataflow
 * service.
 * </pre>
 *
 * Protobuf type {@code google.dataflow.v1beta3.AutoscalingEvent}
 */
public final class AutoscalingEvent extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.dataflow.v1beta3.AutoscalingEvent)
    AutoscalingEventOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use AutoscalingEvent.newBuilder() to construct.
  private AutoscalingEvent(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private AutoscalingEvent() {
    eventType_ = 0;
    workerPool_ = "";
  }

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

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

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.dataflow.v1beta3.MessagesProto
        .internal_static_google_dataflow_v1beta3_AutoscalingEvent_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.dataflow.v1beta3.MessagesProto
        .internal_static_google_dataflow_v1beta3_AutoscalingEvent_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.dataflow.v1beta3.AutoscalingEvent.class,
            com.google.dataflow.v1beta3.AutoscalingEvent.Builder.class);
  }

  /**
   *
   *
   * <pre>
   * Indicates the type of autoscaling event.
   * </pre>
   *
   * Protobuf enum {@code google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType}
   */
  public enum AutoscalingEventType implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *
     *
     * <pre>
     * Default type for the enum.  Value should never be returned.
     * </pre>
     *
     * <code>TYPE_UNKNOWN = 0;</code>
     */
    TYPE_UNKNOWN(0),
    /**
     *
     *
     * <pre>
     * The TARGET_NUM_WORKERS_CHANGED type should be used when the target
     * worker pool size has changed at the start of an actuation. An event
     * should always be specified as TARGET_NUM_WORKERS_CHANGED if it reflects
     * a change in the target_num_workers.
     * </pre>
     *
     * <code>TARGET_NUM_WORKERS_CHANGED = 1;</code>
     */
    TARGET_NUM_WORKERS_CHANGED(1),
    /**
     *
     *
     * <pre>
     * The CURRENT_NUM_WORKERS_CHANGED type should be used when actual worker
     * pool size has been changed, but the target_num_workers has not changed.
     * </pre>
     *
     * <code>CURRENT_NUM_WORKERS_CHANGED = 2;</code>
     */
    CURRENT_NUM_WORKERS_CHANGED(2),
    /**
     *
     *
     * <pre>
     * The ACTUATION_FAILURE type should be used when we want to report
     * an error to the user indicating why the current number of workers
     * in the pool could not be changed.
     * Displayed in the current status and history widgets.
     * </pre>
     *
     * <code>ACTUATION_FAILURE = 3;</code>
     */
    ACTUATION_FAILURE(3),
    /**
     *
     *
     * <pre>
     * Used when we want to report to the user a reason why we are
     * not currently adjusting the number of workers.
     * Should specify both target_num_workers, current_num_workers and a
     * decision_message.
     * </pre>
     *
     * <code>NO_CHANGE = 4;</code>
     */
    NO_CHANGE(4),
    UNRECOGNIZED(-1),
    ;

    /**
     *
     *
     * <pre>
     * Default type for the enum.  Value should never be returned.
     * </pre>
     *
     * <code>TYPE_UNKNOWN = 0;</code>
     */
    public static final int TYPE_UNKNOWN_VALUE = 0;
    /**
     *
     *
     * <pre>
     * The TARGET_NUM_WORKERS_CHANGED type should be used when the target
     * worker pool size has changed at the start of an actuation. An event
     * should always be specified as TARGET_NUM_WORKERS_CHANGED if it reflects
     * a change in the target_num_workers.
     * </pre>
     *
     * <code>TARGET_NUM_WORKERS_CHANGED = 1;</code>
     */
    public static final int TARGET_NUM_WORKERS_CHANGED_VALUE = 1;
    /**
     *
     *
     * <pre>
     * The CURRENT_NUM_WORKERS_CHANGED type should be used when actual worker
     * pool size has been changed, but the target_num_workers has not changed.
     * </pre>
     *
     * <code>CURRENT_NUM_WORKERS_CHANGED = 2;</code>
     */
    public static final int CURRENT_NUM_WORKERS_CHANGED_VALUE = 2;
    /**
     *
     *
     * <pre>
     * The ACTUATION_FAILURE type should be used when we want to report
     * an error to the user indicating why the current number of workers
     * in the pool could not be changed.
     * Displayed in the current status and history widgets.
     * </pre>
     *
     * <code>ACTUATION_FAILURE = 3;</code>
     */
    public static final int ACTUATION_FAILURE_VALUE = 3;
    /**
     *
     *
     * <pre>
     * Used when we want to report to the user a reason why we are
     * not currently adjusting the number of workers.
     * Should specify both target_num_workers, current_num_workers and a
     * decision_message.
     * </pre>
     *
     * <code>NO_CHANGE = 4;</code>
     */
    public static final int NO_CHANGE_VALUE = 4;

    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 AutoscalingEventType 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 AutoscalingEventType forNumber(int value) {
      switch (value) {
        case 0:
          return TYPE_UNKNOWN;
        case 1:
          return TARGET_NUM_WORKERS_CHANGED;
        case 2:
          return CURRENT_NUM_WORKERS_CHANGED;
        case 3:
          return ACTUATION_FAILURE;
        case 4:
          return NO_CHANGE;
        default:
          return null;
      }
    }

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

    private static final com.google.protobuf.Internal.EnumLiteMap<AutoscalingEventType>
        internalValueMap =
            new com.google.protobuf.Internal.EnumLiteMap<AutoscalingEventType>() {
              public AutoscalingEventType findValueByNumber(int number) {
                return AutoscalingEventType.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.dataflow.v1beta3.AutoscalingEvent.getDescriptor().getEnumTypes().get(0);
    }

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

    public static AutoscalingEventType 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 AutoscalingEventType(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType)
  }

  public static final int CURRENT_NUM_WORKERS_FIELD_NUMBER = 1;
  private long currentNumWorkers_ = 0L;
  /**
   *
   *
   * <pre>
   * The current number of workers the job has.
   * </pre>
   *
   * <code>int64 current_num_workers = 1;</code>
   *
   * @return The currentNumWorkers.
   */
  @java.lang.Override
  public long getCurrentNumWorkers() {
    return currentNumWorkers_;
  }

  public static final int TARGET_NUM_WORKERS_FIELD_NUMBER = 2;
  private long targetNumWorkers_ = 0L;
  /**
   *
   *
   * <pre>
   * The target number of workers the worker pool wants to resize to use.
   * </pre>
   *
   * <code>int64 target_num_workers = 2;</code>
   *
   * @return The targetNumWorkers.
   */
  @java.lang.Override
  public long getTargetNumWorkers() {
    return targetNumWorkers_;
  }

  public static final int EVENT_TYPE_FIELD_NUMBER = 3;
  private int eventType_ = 0;
  /**
   *
   *
   * <pre>
   * The type of autoscaling event to report.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType event_type = 3;</code>
   *
   * @return The enum numeric value on the wire for eventType.
   */
  @java.lang.Override
  public int getEventTypeValue() {
    return eventType_;
  }
  /**
   *
   *
   * <pre>
   * The type of autoscaling event to report.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType event_type = 3;</code>
   *
   * @return The eventType.
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType getEventType() {
    com.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType result =
        com.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType.forNumber(eventType_);
    return result == null
        ? com.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType.UNRECOGNIZED
        : result;
  }

  public static final int DESCRIPTION_FIELD_NUMBER = 4;
  private com.google.dataflow.v1beta3.StructuredMessage description_;
  /**
   *
   *
   * <pre>
   * A message describing why the system decided to adjust the current
   * number of workers, why it failed, or why the system decided to
   * not make any changes to the number of workers.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.StructuredMessage description = 4;</code>
   *
   * @return Whether the description field is set.
   */
  @java.lang.Override
  public boolean hasDescription() {
    return description_ != null;
  }
  /**
   *
   *
   * <pre>
   * A message describing why the system decided to adjust the current
   * number of workers, why it failed, or why the system decided to
   * not make any changes to the number of workers.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.StructuredMessage description = 4;</code>
   *
   * @return The description.
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.StructuredMessage getDescription() {
    return description_ == null
        ? com.google.dataflow.v1beta3.StructuredMessage.getDefaultInstance()
        : description_;
  }
  /**
   *
   *
   * <pre>
   * A message describing why the system decided to adjust the current
   * number of workers, why it failed, or why the system decided to
   * not make any changes to the number of workers.
   * </pre>
   *
   * <code>.google.dataflow.v1beta3.StructuredMessage description = 4;</code>
   */
  @java.lang.Override
  public com.google.dataflow.v1beta3.StructuredMessageOrBuilder getDescriptionOrBuilder() {
    return description_ == null
        ? com.google.dataflow.v1beta3.StructuredMessage.getDefaultInstance()
        : description_;
  }

  public static final int TIME_FIELD_NUMBER = 5;
  private com.google.protobuf.Timestamp time_;
  /**
   *
   *
   * <pre>
   * The time this event was emitted to indicate a new target or current
   * num_workers value.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp time = 5;</code>
   *
   * @return Whether the time field is set.
   */
  @java.lang.Override
  public boolean hasTime() {
    return time_ != null;
  }
  /**
   *
   *
   * <pre>
   * The time this event was emitted to indicate a new target or current
   * num_workers value.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp time = 5;</code>
   *
   * @return The time.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getTime() {
    return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
  }
  /**
   *
   *
   * <pre>
   * The time this event was emitted to indicate a new target or current
   * num_workers value.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp time = 5;</code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
    return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
  }

  public static final int WORKER_POOL_FIELD_NUMBER = 7;

  @SuppressWarnings("serial")
  private volatile java.lang.Object workerPool_ = "";
  /**
   *
   *
   * <pre>
   * A short and friendly name for the worker pool this event refers to.
   * </pre>
   *
   * <code>string worker_pool = 7;</code>
   *
   * @return The workerPool.
   */
  @java.lang.Override
  public java.lang.String getWorkerPool() {
    java.lang.Object ref = workerPool_;
    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();
      workerPool_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * A short and friendly name for the worker pool this event refers to.
   * </pre>
   *
   * <code>string worker_pool = 7;</code>
   *
   * @return The bytes for workerPool.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getWorkerPoolBytes() {
    java.lang.Object ref = workerPool_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      workerPool_ = 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 (currentNumWorkers_ != 0L) {
      output.writeInt64(1, currentNumWorkers_);
    }
    if (targetNumWorkers_ != 0L) {
      output.writeInt64(2, targetNumWorkers_);
    }
    if (eventType_
        != com.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType.TYPE_UNKNOWN
            .getNumber()) {
      output.writeEnum(3, eventType_);
    }
    if (description_ != null) {
      output.writeMessage(4, getDescription());
    }
    if (time_ != null) {
      output.writeMessage(5, getTime());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workerPool_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 7, workerPool_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (currentNumWorkers_ != 0L) {
      size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, currentNumWorkers_);
    }
    if (targetNumWorkers_ != 0L) {
      size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, targetNumWorkers_);
    }
    if (eventType_
        != com.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType.TYPE_UNKNOWN
            .getNumber()) {
      size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, eventType_);
    }
    if (description_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDescription());
    }
    if (time_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getTime());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workerPool_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, workerPool_);
    }
    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.dataflow.v1beta3.AutoscalingEvent)) {
      return super.equals(obj);
    }
    com.google.dataflow.v1beta3.AutoscalingEvent other =
        (com.google.dataflow.v1beta3.AutoscalingEvent) obj;

    if (getCurrentNumWorkers() != other.getCurrentNumWorkers()) return false;
    if (getTargetNumWorkers() != other.getTargetNumWorkers()) return false;
    if (eventType_ != other.eventType_) return false;
    if (hasDescription() != other.hasDescription()) return false;
    if (hasDescription()) {
      if (!getDescription().equals(other.getDescription())) return false;
    }
    if (hasTime() != other.hasTime()) return false;
    if (hasTime()) {
      if (!getTime().equals(other.getTime())) return false;
    }
    if (!getWorkerPool().equals(other.getWorkerPool())) 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) + CURRENT_NUM_WORKERS_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCurrentNumWorkers());
    hash = (37 * hash) + TARGET_NUM_WORKERS_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTargetNumWorkers());
    hash = (37 * hash) + EVENT_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + eventType_;
    if (hasDescription()) {
      hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER;
      hash = (53 * hash) + getDescription().hashCode();
    }
    if (hasTime()) {
      hash = (37 * hash) + TIME_FIELD_NUMBER;
      hash = (53 * hash) + getTime().hashCode();
    }
    hash = (37 * hash) + WORKER_POOL_FIELD_NUMBER;
    hash = (53 * hash) + getWorkerPool().hashCode();
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.dataflow.v1beta3.AutoscalingEvent parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.dataflow.v1beta3.AutoscalingEvent parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.dataflow.v1beta3.AutoscalingEvent parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

  public static com.google.dataflow.v1beta3.AutoscalingEvent parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.dataflow.v1beta3.AutoscalingEvent parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

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

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

  public static com.google.dataflow.v1beta3.AutoscalingEvent 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.dataflow.v1beta3.AutoscalingEvent 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 structured message reporting an autoscaling decision made by the Dataflow
   * service.
   * </pre>
   *
   * Protobuf type {@code google.dataflow.v1beta3.AutoscalingEvent}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.dataflow.v1beta3.AutoscalingEvent)
      com.google.dataflow.v1beta3.AutoscalingEventOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.dataflow.v1beta3.MessagesProto
          .internal_static_google_dataflow_v1beta3_AutoscalingEvent_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.dataflow.v1beta3.MessagesProto
          .internal_static_google_dataflow_v1beta3_AutoscalingEvent_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.dataflow.v1beta3.AutoscalingEvent.class,
              com.google.dataflow.v1beta3.AutoscalingEvent.Builder.class);
    }

    // Construct using com.google.dataflow.v1beta3.AutoscalingEvent.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      currentNumWorkers_ = 0L;
      targetNumWorkers_ = 0L;
      eventType_ = 0;
      description_ = null;
      if (descriptionBuilder_ != null) {
        descriptionBuilder_.dispose();
        descriptionBuilder_ = null;
      }
      time_ = null;
      if (timeBuilder_ != null) {
        timeBuilder_.dispose();
        timeBuilder_ = null;
      }
      workerPool_ = "";
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.dataflow.v1beta3.MessagesProto
          .internal_static_google_dataflow_v1beta3_AutoscalingEvent_descriptor;
    }

    @java.lang.Override
    public com.google.dataflow.v1beta3.AutoscalingEvent getDefaultInstanceForType() {
      return com.google.dataflow.v1beta3.AutoscalingEvent.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.dataflow.v1beta3.AutoscalingEvent build() {
      com.google.dataflow.v1beta3.AutoscalingEvent result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.dataflow.v1beta3.AutoscalingEvent buildPartial() {
      com.google.dataflow.v1beta3.AutoscalingEvent result =
          new com.google.dataflow.v1beta3.AutoscalingEvent(this);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartial0(com.google.dataflow.v1beta3.AutoscalingEvent result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.currentNumWorkers_ = currentNumWorkers_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.targetNumWorkers_ = targetNumWorkers_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.eventType_ = eventType_;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.description_ =
            descriptionBuilder_ == null ? description_ : descriptionBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.time_ = timeBuilder_ == null ? time_ : timeBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000020) != 0)) {
        result.workerPool_ = workerPool_;
      }
    }

    @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.dataflow.v1beta3.AutoscalingEvent) {
        return mergeFrom((com.google.dataflow.v1beta3.AutoscalingEvent) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.dataflow.v1beta3.AutoscalingEvent other) {
      if (other == com.google.dataflow.v1beta3.AutoscalingEvent.getDefaultInstance()) return this;
      if (other.getCurrentNumWorkers() != 0L) {
        setCurrentNumWorkers(other.getCurrentNumWorkers());
      }
      if (other.getTargetNumWorkers() != 0L) {
        setTargetNumWorkers(other.getTargetNumWorkers());
      }
      if (other.eventType_ != 0) {
        setEventTypeValue(other.getEventTypeValue());
      }
      if (other.hasDescription()) {
        mergeDescription(other.getDescription());
      }
      if (other.hasTime()) {
        mergeTime(other.getTime());
      }
      if (!other.getWorkerPool().isEmpty()) {
        workerPool_ = other.workerPool_;
        bitField0_ |= 0x00000020;
        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 8:
              {
                currentNumWorkers_ = input.readInt64();
                bitField0_ |= 0x00000001;
                break;
              } // case 8
            case 16:
              {
                targetNumWorkers_ = input.readInt64();
                bitField0_ |= 0x00000002;
                break;
              } // case 16
            case 24:
              {
                eventType_ = input.readEnum();
                bitField0_ |= 0x00000004;
                break;
              } // case 24
            case 34:
              {
                input.readMessage(getDescriptionFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000008;
                break;
              } // case 34
            case 42:
              {
                input.readMessage(getTimeFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000010;
                break;
              } // case 42
            case 58:
              {
                workerPool_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000020;
                break;
              } // case 58
            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 long currentNumWorkers_;
    /**
     *
     *
     * <pre>
     * The current number of workers the job has.
     * </pre>
     *
     * <code>int64 current_num_workers = 1;</code>
     *
     * @return The currentNumWorkers.
     */
    @java.lang.Override
    public long getCurrentNumWorkers() {
      return currentNumWorkers_;
    }
    /**
     *
     *
     * <pre>
     * The current number of workers the job has.
     * </pre>
     *
     * <code>int64 current_num_workers = 1;</code>
     *
     * @param value The currentNumWorkers to set.
     * @return This builder for chaining.
     */
    public Builder setCurrentNumWorkers(long value) {

      currentNumWorkers_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The current number of workers the job has.
     * </pre>
     *
     * <code>int64 current_num_workers = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearCurrentNumWorkers() {
      bitField0_ = (bitField0_ & ~0x00000001);
      currentNumWorkers_ = 0L;
      onChanged();
      return this;
    }

    private long targetNumWorkers_;
    /**
     *
     *
     * <pre>
     * The target number of workers the worker pool wants to resize to use.
     * </pre>
     *
     * <code>int64 target_num_workers = 2;</code>
     *
     * @return The targetNumWorkers.
     */
    @java.lang.Override
    public long getTargetNumWorkers() {
      return targetNumWorkers_;
    }
    /**
     *
     *
     * <pre>
     * The target number of workers the worker pool wants to resize to use.
     * </pre>
     *
     * <code>int64 target_num_workers = 2;</code>
     *
     * @param value The targetNumWorkers to set.
     * @return This builder for chaining.
     */
    public Builder setTargetNumWorkers(long value) {

      targetNumWorkers_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The target number of workers the worker pool wants to resize to use.
     * </pre>
     *
     * <code>int64 target_num_workers = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearTargetNumWorkers() {
      bitField0_ = (bitField0_ & ~0x00000002);
      targetNumWorkers_ = 0L;
      onChanged();
      return this;
    }

    private int eventType_ = 0;
    /**
     *
     *
     * <pre>
     * The type of autoscaling event to report.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType event_type = 3;</code>
     *
     * @return The enum numeric value on the wire for eventType.
     */
    @java.lang.Override
    public int getEventTypeValue() {
      return eventType_;
    }
    /**
     *
     *
     * <pre>
     * The type of autoscaling event to report.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType event_type = 3;</code>
     *
     * @param value The enum numeric value on the wire for eventType to set.
     * @return This builder for chaining.
     */
    public Builder setEventTypeValue(int value) {
      eventType_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The type of autoscaling event to report.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType event_type = 3;</code>
     *
     * @return The eventType.
     */
    @java.lang.Override
    public com.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType getEventType() {
      com.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType result =
          com.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType.forNumber(eventType_);
      return result == null
          ? com.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType.UNRECOGNIZED
          : result;
    }
    /**
     *
     *
     * <pre>
     * The type of autoscaling event to report.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType event_type = 3;</code>
     *
     * @param value The eventType to set.
     * @return This builder for chaining.
     */
    public Builder setEventType(
        com.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000004;
      eventType_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The type of autoscaling event to report.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.AutoscalingEvent.AutoscalingEventType event_type = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearEventType() {
      bitField0_ = (bitField0_ & ~0x00000004);
      eventType_ = 0;
      onChanged();
      return this;
    }

    private com.google.dataflow.v1beta3.StructuredMessage description_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.StructuredMessage,
            com.google.dataflow.v1beta3.StructuredMessage.Builder,
            com.google.dataflow.v1beta3.StructuredMessageOrBuilder>
        descriptionBuilder_;
    /**
     *
     *
     * <pre>
     * A message describing why the system decided to adjust the current
     * number of workers, why it failed, or why the system decided to
     * not make any changes to the number of workers.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StructuredMessage description = 4;</code>
     *
     * @return Whether the description field is set.
     */
    public boolean hasDescription() {
      return ((bitField0_ & 0x00000008) != 0);
    }
    /**
     *
     *
     * <pre>
     * A message describing why the system decided to adjust the current
     * number of workers, why it failed, or why the system decided to
     * not make any changes to the number of workers.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StructuredMessage description = 4;</code>
     *
     * @return The description.
     */
    public com.google.dataflow.v1beta3.StructuredMessage getDescription() {
      if (descriptionBuilder_ == null) {
        return description_ == null
            ? com.google.dataflow.v1beta3.StructuredMessage.getDefaultInstance()
            : description_;
      } else {
        return descriptionBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * A message describing why the system decided to adjust the current
     * number of workers, why it failed, or why the system decided to
     * not make any changes to the number of workers.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StructuredMessage description = 4;</code>
     */
    public Builder setDescription(com.google.dataflow.v1beta3.StructuredMessage value) {
      if (descriptionBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        description_ = value;
      } else {
        descriptionBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A message describing why the system decided to adjust the current
     * number of workers, why it failed, or why the system decided to
     * not make any changes to the number of workers.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StructuredMessage description = 4;</code>
     */
    public Builder setDescription(
        com.google.dataflow.v1beta3.StructuredMessage.Builder builderForValue) {
      if (descriptionBuilder_ == null) {
        description_ = builderForValue.build();
      } else {
        descriptionBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A message describing why the system decided to adjust the current
     * number of workers, why it failed, or why the system decided to
     * not make any changes to the number of workers.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StructuredMessage description = 4;</code>
     */
    public Builder mergeDescription(com.google.dataflow.v1beta3.StructuredMessage value) {
      if (descriptionBuilder_ == null) {
        if (((bitField0_ & 0x00000008) != 0)
            && description_ != null
            && description_ != com.google.dataflow.v1beta3.StructuredMessage.getDefaultInstance()) {
          getDescriptionBuilder().mergeFrom(value);
        } else {
          description_ = value;
        }
      } else {
        descriptionBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A message describing why the system decided to adjust the current
     * number of workers, why it failed, or why the system decided to
     * not make any changes to the number of workers.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StructuredMessage description = 4;</code>
     */
    public Builder clearDescription() {
      bitField0_ = (bitField0_ & ~0x00000008);
      description_ = null;
      if (descriptionBuilder_ != null) {
        descriptionBuilder_.dispose();
        descriptionBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A message describing why the system decided to adjust the current
     * number of workers, why it failed, or why the system decided to
     * not make any changes to the number of workers.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StructuredMessage description = 4;</code>
     */
    public com.google.dataflow.v1beta3.StructuredMessage.Builder getDescriptionBuilder() {
      bitField0_ |= 0x00000008;
      onChanged();
      return getDescriptionFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * A message describing why the system decided to adjust the current
     * number of workers, why it failed, or why the system decided to
     * not make any changes to the number of workers.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StructuredMessage description = 4;</code>
     */
    public com.google.dataflow.v1beta3.StructuredMessageOrBuilder getDescriptionOrBuilder() {
      if (descriptionBuilder_ != null) {
        return descriptionBuilder_.getMessageOrBuilder();
      } else {
        return description_ == null
            ? com.google.dataflow.v1beta3.StructuredMessage.getDefaultInstance()
            : description_;
      }
    }
    /**
     *
     *
     * <pre>
     * A message describing why the system decided to adjust the current
     * number of workers, why it failed, or why the system decided to
     * not make any changes to the number of workers.
     * </pre>
     *
     * <code>.google.dataflow.v1beta3.StructuredMessage description = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.dataflow.v1beta3.StructuredMessage,
            com.google.dataflow.v1beta3.StructuredMessage.Builder,
            com.google.dataflow.v1beta3.StructuredMessageOrBuilder>
        getDescriptionFieldBuilder() {
      if (descriptionBuilder_ == null) {
        descriptionBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.dataflow.v1beta3.StructuredMessage,
                com.google.dataflow.v1beta3.StructuredMessage.Builder,
                com.google.dataflow.v1beta3.StructuredMessageOrBuilder>(
                getDescription(), getParentForChildren(), isClean());
        description_ = null;
      }
      return descriptionBuilder_;
    }

    private com.google.protobuf.Timestamp time_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        timeBuilder_;
    /**
     *
     *
     * <pre>
     * The time this event was emitted to indicate a new target or current
     * num_workers value.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 5;</code>
     *
     * @return Whether the time field is set.
     */
    public boolean hasTime() {
      return ((bitField0_ & 0x00000010) != 0);
    }
    /**
     *
     *
     * <pre>
     * The time this event was emitted to indicate a new target or current
     * num_workers value.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 5;</code>
     *
     * @return The time.
     */
    public com.google.protobuf.Timestamp getTime() {
      if (timeBuilder_ == null) {
        return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
      } else {
        return timeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The time this event was emitted to indicate a new target or current
     * num_workers value.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 5;</code>
     */
    public Builder setTime(com.google.protobuf.Timestamp value) {
      if (timeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        time_ = value;
      } else {
        timeBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The time this event was emitted to indicate a new target or current
     * num_workers value.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 5;</code>
     */
    public Builder setTime(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (timeBuilder_ == null) {
        time_ = builderForValue.build();
      } else {
        timeBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The time this event was emitted to indicate a new target or current
     * num_workers value.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 5;</code>
     */
    public Builder mergeTime(com.google.protobuf.Timestamp value) {
      if (timeBuilder_ == null) {
        if (((bitField0_ & 0x00000010) != 0)
            && time_ != null
            && time_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          getTimeBuilder().mergeFrom(value);
        } else {
          time_ = value;
        }
      } else {
        timeBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The time this event was emitted to indicate a new target or current
     * num_workers value.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 5;</code>
     */
    public Builder clearTime() {
      bitField0_ = (bitField0_ & ~0x00000010);
      time_ = null;
      if (timeBuilder_ != null) {
        timeBuilder_.dispose();
        timeBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The time this event was emitted to indicate a new target or current
     * num_workers value.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 5;</code>
     */
    public com.google.protobuf.Timestamp.Builder getTimeBuilder() {
      bitField0_ |= 0x00000010;
      onChanged();
      return getTimeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The time this event was emitted to indicate a new target or current
     * num_workers value.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 5;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
      if (timeBuilder_ != null) {
        return timeBuilder_.getMessageOrBuilder();
      } else {
        return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
      }
    }
    /**
     *
     *
     * <pre>
     * The time this event was emitted to indicate a new target or current
     * num_workers value.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp time = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getTimeFieldBuilder() {
      if (timeBuilder_ == null) {
        timeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getTime(), getParentForChildren(), isClean());
        time_ = null;
      }
      return timeBuilder_;
    }

    private java.lang.Object workerPool_ = "";
    /**
     *
     *
     * <pre>
     * A short and friendly name for the worker pool this event refers to.
     * </pre>
     *
     * <code>string worker_pool = 7;</code>
     *
     * @return The workerPool.
     */
    public java.lang.String getWorkerPool() {
      java.lang.Object ref = workerPool_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        workerPool_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * A short and friendly name for the worker pool this event refers to.
     * </pre>
     *
     * <code>string worker_pool = 7;</code>
     *
     * @return The bytes for workerPool.
     */
    public com.google.protobuf.ByteString getWorkerPoolBytes() {
      java.lang.Object ref = workerPool_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        workerPool_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * A short and friendly name for the worker pool this event refers to.
     * </pre>
     *
     * <code>string worker_pool = 7;</code>
     *
     * @param value The workerPool to set.
     * @return This builder for chaining.
     */
    public Builder setWorkerPool(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      workerPool_ = value;
      bitField0_ |= 0x00000020;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A short and friendly name for the worker pool this event refers to.
     * </pre>
     *
     * <code>string worker_pool = 7;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearWorkerPool() {
      workerPool_ = getDefaultInstance().getWorkerPool();
      bitField0_ = (bitField0_ & ~0x00000020);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * A short and friendly name for the worker pool this event refers to.
     * </pre>
     *
     * <code>string worker_pool = 7;</code>
     *
     * @param value The bytes for workerPool to set.
     * @return This builder for chaining.
     */
    public Builder setWorkerPoolBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      workerPool_ = value;
      bitField0_ |= 0x00000020;
      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.dataflow.v1beta3.AutoscalingEvent)
  }

  // @@protoc_insertion_point(class_scope:google.dataflow.v1beta3.AutoscalingEvent)
  private static final com.google.dataflow.v1beta3.AutoscalingEvent DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.dataflow.v1beta3.AutoscalingEvent();
  }

  public static com.google.dataflow.v1beta3.AutoscalingEvent getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<AutoscalingEvent> PARSER =
      new com.google.protobuf.AbstractParser<AutoscalingEvent>() {
        @java.lang.Override
        public AutoscalingEvent 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<AutoscalingEvent> parser() {
    return PARSER;
  }

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

  @java.lang.Override
  public com.google.dataflow.v1beta3.AutoscalingEvent getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
