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

package com.google.cloud.dataproc.v1beta2;

/**
 * <pre>
 * A Cloud Dataproc workflow template resource.
 * </pre>
 *
 * Protobuf type {@code google.cloud.dataproc.v1beta2.WorkflowMetadata}
 */
public  final class WorkflowMetadata extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.cloud.dataproc.v1beta2.WorkflowMetadata)
    WorkflowMetadataOrBuilder {
private static final long serialVersionUID = 0L;
  // Use WorkflowMetadata.newBuilder() to construct.
  private WorkflowMetadata(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private WorkflowMetadata() {
    template_ = "";
    version_ = 0;
    state_ = 0;
    clusterName_ = "";
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private WorkflowMetadata(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10: {
            java.lang.String s = input.readStringRequireUtf8();

            template_ = s;
            break;
          }
          case 16: {

            version_ = input.readInt32();
            break;
          }
          case 26: {
            com.google.cloud.dataproc.v1beta2.ClusterOperation.Builder subBuilder = null;
            if (createCluster_ != null) {
              subBuilder = createCluster_.toBuilder();
            }
            createCluster_ = input.readMessage(com.google.cloud.dataproc.v1beta2.ClusterOperation.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(createCluster_);
              createCluster_ = subBuilder.buildPartial();
            }

            break;
          }
          case 34: {
            com.google.cloud.dataproc.v1beta2.WorkflowGraph.Builder subBuilder = null;
            if (graph_ != null) {
              subBuilder = graph_.toBuilder();
            }
            graph_ = input.readMessage(com.google.cloud.dataproc.v1beta2.WorkflowGraph.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(graph_);
              graph_ = subBuilder.buildPartial();
            }

            break;
          }
          case 42: {
            com.google.cloud.dataproc.v1beta2.ClusterOperation.Builder subBuilder = null;
            if (deleteCluster_ != null) {
              subBuilder = deleteCluster_.toBuilder();
            }
            deleteCluster_ = input.readMessage(com.google.cloud.dataproc.v1beta2.ClusterOperation.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(deleteCluster_);
              deleteCluster_ = subBuilder.buildPartial();
            }

            break;
          }
          case 48: {
            int rawValue = input.readEnum();

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

            clusterName_ = s;
            break;
          }
          case 66: {
            if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) {
              parameters_ = com.google.protobuf.MapField.newMapField(
                  ParametersDefaultEntryHolder.defaultEntry);
              mutable_bitField0_ |= 0x00000080;
            }
            com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
            parameters__ = input.readMessage(
                ParametersDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
            parameters_.getMutableMap().put(
                parameters__.getKey(), parameters__.getValue());
            break;
          }
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.cloud.dataproc.v1beta2.WorkflowTemplatesProto.internal_static_google_cloud_dataproc_v1beta2_WorkflowMetadata_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapField internalGetMapField(
      int number) {
    switch (number) {
      case 8:
        return internalGetParameters();
      default:
        throw new RuntimeException(
            "Invalid map field number: " + number);
    }
  }
  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.dataproc.v1beta2.WorkflowTemplatesProto.internal_static_google_cloud_dataproc_v1beta2_WorkflowMetadata_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.dataproc.v1beta2.WorkflowMetadata.class, com.google.cloud.dataproc.v1beta2.WorkflowMetadata.Builder.class);
  }

  /**
   * <pre>
   * The operation state.
   * </pre>
   *
   * Protobuf enum {@code google.cloud.dataproc.v1beta2.WorkflowMetadata.State}
   */
  public enum State
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * <pre>
     * Unused.
     * </pre>
     *
     * <code>UNKNOWN = 0;</code>
     */
    UNKNOWN(0),
    /**
     * <pre>
     * The operation has been created.
     * </pre>
     *
     * <code>PENDING = 1;</code>
     */
    PENDING(1),
    /**
     * <pre>
     * The operation is running.
     * </pre>
     *
     * <code>RUNNING = 2;</code>
     */
    RUNNING(2),
    /**
     * <pre>
     * The operation is done; either cancelled or completed.
     * </pre>
     *
     * <code>DONE = 3;</code>
     */
    DONE(3),
    UNRECOGNIZED(-1),
    ;

    /**
     * <pre>
     * Unused.
     * </pre>
     *
     * <code>UNKNOWN = 0;</code>
     */
    public static final int UNKNOWN_VALUE = 0;
    /**
     * <pre>
     * The operation has been created.
     * </pre>
     *
     * <code>PENDING = 1;</code>
     */
    public static final int PENDING_VALUE = 1;
    /**
     * <pre>
     * The operation is running.
     * </pre>
     *
     * <code>RUNNING = 2;</code>
     */
    public static final int RUNNING_VALUE = 2;
    /**
     * <pre>
     * The operation is done; either cancelled or completed.
     * </pre>
     *
     * <code>DONE = 3;</code>
     */
    public static final int DONE_VALUE = 3;


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

    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static State valueOf(int value) {
      return forNumber(value);
    }

    public static State forNumber(int value) {
      switch (value) {
        case 0: return UNKNOWN;
        case 1: return PENDING;
        case 2: return RUNNING;
        case 3: return DONE;
        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() {
      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.dataproc.v1beta2.WorkflowMetadata.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.dataproc.v1beta2.WorkflowMetadata.State)
  }

  private int bitField0_;
  public static final int TEMPLATE_FIELD_NUMBER = 1;
  private volatile java.lang.Object template_;
  /**
   * <pre>
   * Output only. The "resource name" of the template.
   * </pre>
   *
   * <code>string template = 1;</code>
   */
  public java.lang.String getTemplate() {
    java.lang.Object ref = template_;
    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();
      template_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Output only. The "resource name" of the template.
   * </pre>
   *
   * <code>string template = 1;</code>
   */
  public com.google.protobuf.ByteString
      getTemplateBytes() {
    java.lang.Object ref = template_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      template_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int VERSION_FIELD_NUMBER = 2;
  private int version_;
  /**
   * <pre>
   * Output only. The version of template at the time of
   * workflow instantiation.
   * </pre>
   *
   * <code>int32 version = 2;</code>
   */
  public int getVersion() {
    return version_;
  }

  public static final int CREATE_CLUSTER_FIELD_NUMBER = 3;
  private com.google.cloud.dataproc.v1beta2.ClusterOperation createCluster_;
  /**
   * <pre>
   * Output only. The create cluster operation metadata.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1beta2.ClusterOperation create_cluster = 3;</code>
   */
  public boolean hasCreateCluster() {
    return createCluster_ != null;
  }
  /**
   * <pre>
   * Output only. The create cluster operation metadata.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1beta2.ClusterOperation create_cluster = 3;</code>
   */
  public com.google.cloud.dataproc.v1beta2.ClusterOperation getCreateCluster() {
    return createCluster_ == null ? com.google.cloud.dataproc.v1beta2.ClusterOperation.getDefaultInstance() : createCluster_;
  }
  /**
   * <pre>
   * Output only. The create cluster operation metadata.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1beta2.ClusterOperation create_cluster = 3;</code>
   */
  public com.google.cloud.dataproc.v1beta2.ClusterOperationOrBuilder getCreateClusterOrBuilder() {
    return getCreateCluster();
  }

  public static final int GRAPH_FIELD_NUMBER = 4;
  private com.google.cloud.dataproc.v1beta2.WorkflowGraph graph_;
  /**
   * <pre>
   * Output only. The workflow graph.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1beta2.WorkflowGraph graph = 4;</code>
   */
  public boolean hasGraph() {
    return graph_ != null;
  }
  /**
   * <pre>
   * Output only. The workflow graph.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1beta2.WorkflowGraph graph = 4;</code>
   */
  public com.google.cloud.dataproc.v1beta2.WorkflowGraph getGraph() {
    return graph_ == null ? com.google.cloud.dataproc.v1beta2.WorkflowGraph.getDefaultInstance() : graph_;
  }
  /**
   * <pre>
   * Output only. The workflow graph.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1beta2.WorkflowGraph graph = 4;</code>
   */
  public com.google.cloud.dataproc.v1beta2.WorkflowGraphOrBuilder getGraphOrBuilder() {
    return getGraph();
  }

  public static final int DELETE_CLUSTER_FIELD_NUMBER = 5;
  private com.google.cloud.dataproc.v1beta2.ClusterOperation deleteCluster_;
  /**
   * <pre>
   * Output only. The delete cluster operation metadata.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1beta2.ClusterOperation delete_cluster = 5;</code>
   */
  public boolean hasDeleteCluster() {
    return deleteCluster_ != null;
  }
  /**
   * <pre>
   * Output only. The delete cluster operation metadata.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1beta2.ClusterOperation delete_cluster = 5;</code>
   */
  public com.google.cloud.dataproc.v1beta2.ClusterOperation getDeleteCluster() {
    return deleteCluster_ == null ? com.google.cloud.dataproc.v1beta2.ClusterOperation.getDefaultInstance() : deleteCluster_;
  }
  /**
   * <pre>
   * Output only. The delete cluster operation metadata.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1beta2.ClusterOperation delete_cluster = 5;</code>
   */
  public com.google.cloud.dataproc.v1beta2.ClusterOperationOrBuilder getDeleteClusterOrBuilder() {
    return getDeleteCluster();
  }

  public static final int STATE_FIELD_NUMBER = 6;
  private int state_;
  /**
   * <pre>
   * Output only. The workflow state.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1beta2.WorkflowMetadata.State state = 6;</code>
   */
  public int getStateValue() {
    return state_;
  }
  /**
   * <pre>
   * Output only. The workflow state.
   * </pre>
   *
   * <code>.google.cloud.dataproc.v1beta2.WorkflowMetadata.State state = 6;</code>
   */
  public com.google.cloud.dataproc.v1beta2.WorkflowMetadata.State getState() {
    @SuppressWarnings("deprecation")
    com.google.cloud.dataproc.v1beta2.WorkflowMetadata.State result = com.google.cloud.dataproc.v1beta2.WorkflowMetadata.State.valueOf(state_);
    return result == null ? com.google.cloud.dataproc.v1beta2.WorkflowMetadata.State.UNRECOGNIZED : result;
  }

  public static final int CLUSTER_NAME_FIELD_NUMBER = 7;
  private volatile java.lang.Object clusterName_;
  /**
   * <pre>
   * Output only. The name of the managed cluster.
   * </pre>
   *
   * <code>string cluster_name = 7;</code>
   */
  public java.lang.String getClusterName() {
    java.lang.Object ref = clusterName_;
    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();
      clusterName_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Output only. The name of the managed cluster.
   * </pre>
   *
   * <code>string cluster_name = 7;</code>
   */
  public com.google.protobuf.ByteString
      getClusterNameBytes() {
    java.lang.Object ref = clusterName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      clusterName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PARAMETERS_FIELD_NUMBER = 8;
  private static final class ParametersDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<
        java.lang.String, java.lang.String> defaultEntry =
            com.google.protobuf.MapEntry
            .<java.lang.String, java.lang.String>newDefaultInstance(
                com.google.cloud.dataproc.v1beta2.WorkflowTemplatesProto.internal_static_google_cloud_dataproc_v1beta2_WorkflowMetadata_ParametersEntry_descriptor, 
                com.google.protobuf.WireFormat.FieldType.STRING,
                "",
                com.google.protobuf.WireFormat.FieldType.STRING,
                "");
  }
  private com.google.protobuf.MapField<
      java.lang.String, java.lang.String> parameters_;
  private com.google.protobuf.MapField<java.lang.String, java.lang.String>
  internalGetParameters() {
    if (parameters_ == null) {
      return com.google.protobuf.MapField.emptyMapField(
          ParametersDefaultEntryHolder.defaultEntry);
    }
    return parameters_;
  }

  public int getParametersCount() {
    return internalGetParameters().getMap().size();
  }
  /**
   * <pre>
   * Map from parameter names to values that were used for those parameters.
   * </pre>
   *
   * <code>map&lt;string, string&gt; parameters = 8;</code>
   */

  public boolean containsParameters(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    return internalGetParameters().getMap().containsKey(key);
  }
  /**
   * Use {@link #getParametersMap()} instead.
   */
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getParameters() {
    return getParametersMap();
  }
  /**
   * <pre>
   * Map from parameter names to values that were used for those parameters.
   * </pre>
   *
   * <code>map&lt;string, string&gt; parameters = 8;</code>
   */

  public java.util.Map<java.lang.String, java.lang.String> getParametersMap() {
    return internalGetParameters().getMap();
  }
  /**
   * <pre>
   * Map from parameter names to values that were used for those parameters.
   * </pre>
   *
   * <code>map&lt;string, string&gt; parameters = 8;</code>
   */

  public java.lang.String getParametersOrDefault(
      java.lang.String key,
      java.lang.String defaultValue) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetParameters().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   * <pre>
   * Map from parameter names to values that were used for those parameters.
   * </pre>
   *
   * <code>map&lt;string, string&gt; parameters = 8;</code>
   */

  public java.lang.String getParametersOrThrow(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetParameters().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (!getTemplateBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, template_);
    }
    if (version_ != 0) {
      output.writeInt32(2, version_);
    }
    if (createCluster_ != null) {
      output.writeMessage(3, getCreateCluster());
    }
    if (graph_ != null) {
      output.writeMessage(4, getGraph());
    }
    if (deleteCluster_ != null) {
      output.writeMessage(5, getDeleteCluster());
    }
    if (state_ != com.google.cloud.dataproc.v1beta2.WorkflowMetadata.State.UNKNOWN.getNumber()) {
      output.writeEnum(6, state_);
    }
    if (!getClusterNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 7, clusterName_);
    }
    com.google.protobuf.GeneratedMessageV3
      .serializeStringMapTo(
        output,
        internalGetParameters(),
        ParametersDefaultEntryHolder.defaultEntry,
        8);
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getTemplateBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, template_);
    }
    if (version_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(2, version_);
    }
    if (createCluster_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, getCreateCluster());
    }
    if (graph_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, getGraph());
    }
    if (deleteCluster_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, getDeleteCluster());
    }
    if (state_ != com.google.cloud.dataproc.v1beta2.WorkflowMetadata.State.UNKNOWN.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(6, state_);
    }
    if (!getClusterNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, clusterName_);
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry
         : internalGetParameters().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
      parameters__ = ParametersDefaultEntryHolder.defaultEntry.newBuilderForType()
          .setKey(entry.getKey())
          .setValue(entry.getValue())
          .build();
      size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(8, parameters__);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

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

    boolean result = true;
    result = result && getTemplate()
        .equals(other.getTemplate());
    result = result && (getVersion()
        == other.getVersion());
    result = result && (hasCreateCluster() == other.hasCreateCluster());
    if (hasCreateCluster()) {
      result = result && getCreateCluster()
          .equals(other.getCreateCluster());
    }
    result = result && (hasGraph() == other.hasGraph());
    if (hasGraph()) {
      result = result && getGraph()
          .equals(other.getGraph());
    }
    result = result && (hasDeleteCluster() == other.hasDeleteCluster());
    if (hasDeleteCluster()) {
      result = result && getDeleteCluster()
          .equals(other.getDeleteCluster());
    }
    result = result && state_ == other.state_;
    result = result && getClusterName()
        .equals(other.getClusterName());
    result = result && internalGetParameters().equals(
        other.internalGetParameters());
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + TEMPLATE_FIELD_NUMBER;
    hash = (53 * hash) + getTemplate().hashCode();
    hash = (37 * hash) + VERSION_FIELD_NUMBER;
    hash = (53 * hash) + getVersion();
    if (hasCreateCluster()) {
      hash = (37 * hash) + CREATE_CLUSTER_FIELD_NUMBER;
      hash = (53 * hash) + getCreateCluster().hashCode();
    }
    if (hasGraph()) {
      hash = (37 * hash) + GRAPH_FIELD_NUMBER;
      hash = (53 * hash) + getGraph().hashCode();
    }
    if (hasDeleteCluster()) {
      hash = (37 * hash) + DELETE_CLUSTER_FIELD_NUMBER;
      hash = (53 * hash) + getDeleteCluster().hashCode();
    }
    hash = (37 * hash) + STATE_FIELD_NUMBER;
    hash = (53 * hash) + state_;
    hash = (37 * hash) + CLUSTER_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getClusterName().hashCode();
    if (!internalGetParameters().getMap().isEmpty()) {
      hash = (37 * hash) + PARAMETERS_FIELD_NUMBER;
      hash = (53 * hash) + internalGetParameters().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.dataproc.v1beta2.WorkflowMetadata parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.dataproc.v1beta2.WorkflowMetadata parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.dataproc.v1beta2.WorkflowMetadata parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.dataproc.v1beta2.WorkflowMetadata parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.dataproc.v1beta2.WorkflowMetadata parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.dataproc.v1beta2.WorkflowMetadata parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.dataproc.v1beta2.WorkflowMetadata parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.dataproc.v1beta2.WorkflowMetadata parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.cloud.dataproc.v1beta2.WorkflowMetadata parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.cloud.dataproc.v1beta2.WorkflowMetadata parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.cloud.dataproc.v1beta2.WorkflowMetadata parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.dataproc.v1beta2.WorkflowMetadata parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.cloud.dataproc.v1beta2.WorkflowMetadata 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 Cloud Dataproc workflow template resource.
   * </pre>
   *
   * Protobuf type {@code google.cloud.dataproc.v1beta2.WorkflowMetadata}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.cloud.dataproc.v1beta2.WorkflowMetadata)
      com.google.cloud.dataproc.v1beta2.WorkflowMetadataOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.cloud.dataproc.v1beta2.WorkflowTemplatesProto.internal_static_google_cloud_dataproc_v1beta2_WorkflowMetadata_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(
        int number) {
      switch (number) {
        case 8:
          return internalGetParameters();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(
        int number) {
      switch (number) {
        case 8:
          return internalGetMutableParameters();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.dataproc.v1beta2.WorkflowTemplatesProto.internal_static_google_cloud_dataproc_v1beta2_WorkflowMetadata_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.dataproc.v1beta2.WorkflowMetadata.class, com.google.cloud.dataproc.v1beta2.WorkflowMetadata.Builder.class);
    }

    // Construct using com.google.cloud.dataproc.v1beta2.WorkflowMetadata.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      template_ = "";

      version_ = 0;

      if (createClusterBuilder_ == null) {
        createCluster_ = null;
      } else {
        createCluster_ = null;
        createClusterBuilder_ = null;
      }
      if (graphBuilder_ == null) {
        graph_ = null;
      } else {
        graph_ = null;
        graphBuilder_ = null;
      }
      if (deleteClusterBuilder_ == null) {
        deleteCluster_ = null;
      } else {
        deleteCluster_ = null;
        deleteClusterBuilder_ = null;
      }
      state_ = 0;

      clusterName_ = "";

      internalGetMutableParameters().clear();
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.cloud.dataproc.v1beta2.WorkflowTemplatesProto.internal_static_google_cloud_dataproc_v1beta2_WorkflowMetadata_descriptor;
    }

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

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

    @java.lang.Override
    public com.google.cloud.dataproc.v1beta2.WorkflowMetadata buildPartial() {
      com.google.cloud.dataproc.v1beta2.WorkflowMetadata result = new com.google.cloud.dataproc.v1beta2.WorkflowMetadata(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.template_ = template_;
      result.version_ = version_;
      if (createClusterBuilder_ == null) {
        result.createCluster_ = createCluster_;
      } else {
        result.createCluster_ = createClusterBuilder_.build();
      }
      if (graphBuilder_ == null) {
        result.graph_ = graph_;
      } else {
        result.graph_ = graphBuilder_.build();
      }
      if (deleteClusterBuilder_ == null) {
        result.deleteCluster_ = deleteCluster_;
      } else {
        result.deleteCluster_ = deleteClusterBuilder_.build();
      }
      result.state_ = state_;
      result.clusterName_ = clusterName_;
      result.parameters_ = internalGetParameters();
      result.parameters_.makeImmutable();
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return (Builder) super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.dataproc.v1beta2.WorkflowMetadata) {
        return mergeFrom((com.google.cloud.dataproc.v1beta2.WorkflowMetadata)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.dataproc.v1beta2.WorkflowMetadata other) {
      if (other == com.google.cloud.dataproc.v1beta2.WorkflowMetadata.getDefaultInstance()) return this;
      if (!other.getTemplate().isEmpty()) {
        template_ = other.template_;
        onChanged();
      }
      if (other.getVersion() != 0) {
        setVersion(other.getVersion());
      }
      if (other.hasCreateCluster()) {
        mergeCreateCluster(other.getCreateCluster());
      }
      if (other.hasGraph()) {
        mergeGraph(other.getGraph());
      }
      if (other.hasDeleteCluster()) {
        mergeDeleteCluster(other.getDeleteCluster());
      }
      if (other.state_ != 0) {
        setStateValue(other.getStateValue());
      }
      if (!other.getClusterName().isEmpty()) {
        clusterName_ = other.clusterName_;
        onChanged();
      }
      internalGetMutableParameters().mergeFrom(
          other.internalGetParameters());
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

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

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.cloud.dataproc.v1beta2.WorkflowMetadata parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.dataproc.v1beta2.WorkflowMetadata) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private java.lang.Object template_ = "";
    /**
     * <pre>
     * Output only. The "resource name" of the template.
     * </pre>
     *
     * <code>string template = 1;</code>
     */
    public java.lang.String getTemplate() {
      java.lang.Object ref = template_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        template_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Output only. The "resource name" of the template.
     * </pre>
     *
     * <code>string template = 1;</code>
     */
    public com.google.protobuf.ByteString
        getTemplateBytes() {
      java.lang.Object ref = template_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        template_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Output only. The "resource name" of the template.
     * </pre>
     *
     * <code>string template = 1;</code>
     */
    public Builder setTemplate(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      template_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Output only. The "resource name" of the template.
     * </pre>
     *
     * <code>string template = 1;</code>
     */
    public Builder clearTemplate() {
      
      template_ = getDefaultInstance().getTemplate();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Output only. The "resource name" of the template.
     * </pre>
     *
     * <code>string template = 1;</code>
     */
    public Builder setTemplateBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      template_ = value;
      onChanged();
      return this;
    }

    private int version_ ;
    /**
     * <pre>
     * Output only. The version of template at the time of
     * workflow instantiation.
     * </pre>
     *
     * <code>int32 version = 2;</code>
     */
    public int getVersion() {
      return version_;
    }
    /**
     * <pre>
     * Output only. The version of template at the time of
     * workflow instantiation.
     * </pre>
     *
     * <code>int32 version = 2;</code>
     */
    public Builder setVersion(int value) {
      
      version_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Output only. The version of template at the time of
     * workflow instantiation.
     * </pre>
     *
     * <code>int32 version = 2;</code>
     */
    public Builder clearVersion() {
      
      version_ = 0;
      onChanged();
      return this;
    }

    private com.google.cloud.dataproc.v1beta2.ClusterOperation createCluster_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1beta2.ClusterOperation, com.google.cloud.dataproc.v1beta2.ClusterOperation.Builder, com.google.cloud.dataproc.v1beta2.ClusterOperationOrBuilder> createClusterBuilder_;
    /**
     * <pre>
     * Output only. The create cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation create_cluster = 3;</code>
     */
    public boolean hasCreateCluster() {
      return createClusterBuilder_ != null || createCluster_ != null;
    }
    /**
     * <pre>
     * Output only. The create cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation create_cluster = 3;</code>
     */
    public com.google.cloud.dataproc.v1beta2.ClusterOperation getCreateCluster() {
      if (createClusterBuilder_ == null) {
        return createCluster_ == null ? com.google.cloud.dataproc.v1beta2.ClusterOperation.getDefaultInstance() : createCluster_;
      } else {
        return createClusterBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Output only. The create cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation create_cluster = 3;</code>
     */
    public Builder setCreateCluster(com.google.cloud.dataproc.v1beta2.ClusterOperation value) {
      if (createClusterBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        createCluster_ = value;
        onChanged();
      } else {
        createClusterBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The create cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation create_cluster = 3;</code>
     */
    public Builder setCreateCluster(
        com.google.cloud.dataproc.v1beta2.ClusterOperation.Builder builderForValue) {
      if (createClusterBuilder_ == null) {
        createCluster_ = builderForValue.build();
        onChanged();
      } else {
        createClusterBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The create cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation create_cluster = 3;</code>
     */
    public Builder mergeCreateCluster(com.google.cloud.dataproc.v1beta2.ClusterOperation value) {
      if (createClusterBuilder_ == null) {
        if (createCluster_ != null) {
          createCluster_ =
            com.google.cloud.dataproc.v1beta2.ClusterOperation.newBuilder(createCluster_).mergeFrom(value).buildPartial();
        } else {
          createCluster_ = value;
        }
        onChanged();
      } else {
        createClusterBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The create cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation create_cluster = 3;</code>
     */
    public Builder clearCreateCluster() {
      if (createClusterBuilder_ == null) {
        createCluster_ = null;
        onChanged();
      } else {
        createCluster_ = null;
        createClusterBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The create cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation create_cluster = 3;</code>
     */
    public com.google.cloud.dataproc.v1beta2.ClusterOperation.Builder getCreateClusterBuilder() {
      
      onChanged();
      return getCreateClusterFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Output only. The create cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation create_cluster = 3;</code>
     */
    public com.google.cloud.dataproc.v1beta2.ClusterOperationOrBuilder getCreateClusterOrBuilder() {
      if (createClusterBuilder_ != null) {
        return createClusterBuilder_.getMessageOrBuilder();
      } else {
        return createCluster_ == null ?
            com.google.cloud.dataproc.v1beta2.ClusterOperation.getDefaultInstance() : createCluster_;
      }
    }
    /**
     * <pre>
     * Output only. The create cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation create_cluster = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1beta2.ClusterOperation, com.google.cloud.dataproc.v1beta2.ClusterOperation.Builder, com.google.cloud.dataproc.v1beta2.ClusterOperationOrBuilder> 
        getCreateClusterFieldBuilder() {
      if (createClusterBuilder_ == null) {
        createClusterBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dataproc.v1beta2.ClusterOperation, com.google.cloud.dataproc.v1beta2.ClusterOperation.Builder, com.google.cloud.dataproc.v1beta2.ClusterOperationOrBuilder>(
                getCreateCluster(),
                getParentForChildren(),
                isClean());
        createCluster_ = null;
      }
      return createClusterBuilder_;
    }

    private com.google.cloud.dataproc.v1beta2.WorkflowGraph graph_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1beta2.WorkflowGraph, com.google.cloud.dataproc.v1beta2.WorkflowGraph.Builder, com.google.cloud.dataproc.v1beta2.WorkflowGraphOrBuilder> graphBuilder_;
    /**
     * <pre>
     * Output only. The workflow graph.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.WorkflowGraph graph = 4;</code>
     */
    public boolean hasGraph() {
      return graphBuilder_ != null || graph_ != null;
    }
    /**
     * <pre>
     * Output only. The workflow graph.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.WorkflowGraph graph = 4;</code>
     */
    public com.google.cloud.dataproc.v1beta2.WorkflowGraph getGraph() {
      if (graphBuilder_ == null) {
        return graph_ == null ? com.google.cloud.dataproc.v1beta2.WorkflowGraph.getDefaultInstance() : graph_;
      } else {
        return graphBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Output only. The workflow graph.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.WorkflowGraph graph = 4;</code>
     */
    public Builder setGraph(com.google.cloud.dataproc.v1beta2.WorkflowGraph value) {
      if (graphBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        graph_ = value;
        onChanged();
      } else {
        graphBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The workflow graph.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.WorkflowGraph graph = 4;</code>
     */
    public Builder setGraph(
        com.google.cloud.dataproc.v1beta2.WorkflowGraph.Builder builderForValue) {
      if (graphBuilder_ == null) {
        graph_ = builderForValue.build();
        onChanged();
      } else {
        graphBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The workflow graph.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.WorkflowGraph graph = 4;</code>
     */
    public Builder mergeGraph(com.google.cloud.dataproc.v1beta2.WorkflowGraph value) {
      if (graphBuilder_ == null) {
        if (graph_ != null) {
          graph_ =
            com.google.cloud.dataproc.v1beta2.WorkflowGraph.newBuilder(graph_).mergeFrom(value).buildPartial();
        } else {
          graph_ = value;
        }
        onChanged();
      } else {
        graphBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The workflow graph.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.WorkflowGraph graph = 4;</code>
     */
    public Builder clearGraph() {
      if (graphBuilder_ == null) {
        graph_ = null;
        onChanged();
      } else {
        graph_ = null;
        graphBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The workflow graph.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.WorkflowGraph graph = 4;</code>
     */
    public com.google.cloud.dataproc.v1beta2.WorkflowGraph.Builder getGraphBuilder() {
      
      onChanged();
      return getGraphFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Output only. The workflow graph.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.WorkflowGraph graph = 4;</code>
     */
    public com.google.cloud.dataproc.v1beta2.WorkflowGraphOrBuilder getGraphOrBuilder() {
      if (graphBuilder_ != null) {
        return graphBuilder_.getMessageOrBuilder();
      } else {
        return graph_ == null ?
            com.google.cloud.dataproc.v1beta2.WorkflowGraph.getDefaultInstance() : graph_;
      }
    }
    /**
     * <pre>
     * Output only. The workflow graph.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.WorkflowGraph graph = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1beta2.WorkflowGraph, com.google.cloud.dataproc.v1beta2.WorkflowGraph.Builder, com.google.cloud.dataproc.v1beta2.WorkflowGraphOrBuilder> 
        getGraphFieldBuilder() {
      if (graphBuilder_ == null) {
        graphBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dataproc.v1beta2.WorkflowGraph, com.google.cloud.dataproc.v1beta2.WorkflowGraph.Builder, com.google.cloud.dataproc.v1beta2.WorkflowGraphOrBuilder>(
                getGraph(),
                getParentForChildren(),
                isClean());
        graph_ = null;
      }
      return graphBuilder_;
    }

    private com.google.cloud.dataproc.v1beta2.ClusterOperation deleteCluster_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1beta2.ClusterOperation, com.google.cloud.dataproc.v1beta2.ClusterOperation.Builder, com.google.cloud.dataproc.v1beta2.ClusterOperationOrBuilder> deleteClusterBuilder_;
    /**
     * <pre>
     * Output only. The delete cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation delete_cluster = 5;</code>
     */
    public boolean hasDeleteCluster() {
      return deleteClusterBuilder_ != null || deleteCluster_ != null;
    }
    /**
     * <pre>
     * Output only. The delete cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation delete_cluster = 5;</code>
     */
    public com.google.cloud.dataproc.v1beta2.ClusterOperation getDeleteCluster() {
      if (deleteClusterBuilder_ == null) {
        return deleteCluster_ == null ? com.google.cloud.dataproc.v1beta2.ClusterOperation.getDefaultInstance() : deleteCluster_;
      } else {
        return deleteClusterBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Output only. The delete cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation delete_cluster = 5;</code>
     */
    public Builder setDeleteCluster(com.google.cloud.dataproc.v1beta2.ClusterOperation value) {
      if (deleteClusterBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        deleteCluster_ = value;
        onChanged();
      } else {
        deleteClusterBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The delete cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation delete_cluster = 5;</code>
     */
    public Builder setDeleteCluster(
        com.google.cloud.dataproc.v1beta2.ClusterOperation.Builder builderForValue) {
      if (deleteClusterBuilder_ == null) {
        deleteCluster_ = builderForValue.build();
        onChanged();
      } else {
        deleteClusterBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The delete cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation delete_cluster = 5;</code>
     */
    public Builder mergeDeleteCluster(com.google.cloud.dataproc.v1beta2.ClusterOperation value) {
      if (deleteClusterBuilder_ == null) {
        if (deleteCluster_ != null) {
          deleteCluster_ =
            com.google.cloud.dataproc.v1beta2.ClusterOperation.newBuilder(deleteCluster_).mergeFrom(value).buildPartial();
        } else {
          deleteCluster_ = value;
        }
        onChanged();
      } else {
        deleteClusterBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The delete cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation delete_cluster = 5;</code>
     */
    public Builder clearDeleteCluster() {
      if (deleteClusterBuilder_ == null) {
        deleteCluster_ = null;
        onChanged();
      } else {
        deleteCluster_ = null;
        deleteClusterBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Output only. The delete cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation delete_cluster = 5;</code>
     */
    public com.google.cloud.dataproc.v1beta2.ClusterOperation.Builder getDeleteClusterBuilder() {
      
      onChanged();
      return getDeleteClusterFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Output only. The delete cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation delete_cluster = 5;</code>
     */
    public com.google.cloud.dataproc.v1beta2.ClusterOperationOrBuilder getDeleteClusterOrBuilder() {
      if (deleteClusterBuilder_ != null) {
        return deleteClusterBuilder_.getMessageOrBuilder();
      } else {
        return deleteCluster_ == null ?
            com.google.cloud.dataproc.v1beta2.ClusterOperation.getDefaultInstance() : deleteCluster_;
      }
    }
    /**
     * <pre>
     * Output only. The delete cluster operation metadata.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.ClusterOperation delete_cluster = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dataproc.v1beta2.ClusterOperation, com.google.cloud.dataproc.v1beta2.ClusterOperation.Builder, com.google.cloud.dataproc.v1beta2.ClusterOperationOrBuilder> 
        getDeleteClusterFieldBuilder() {
      if (deleteClusterBuilder_ == null) {
        deleteClusterBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dataproc.v1beta2.ClusterOperation, com.google.cloud.dataproc.v1beta2.ClusterOperation.Builder, com.google.cloud.dataproc.v1beta2.ClusterOperationOrBuilder>(
                getDeleteCluster(),
                getParentForChildren(),
                isClean());
        deleteCluster_ = null;
      }
      return deleteClusterBuilder_;
    }

    private int state_ = 0;
    /**
     * <pre>
     * Output only. The workflow state.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.WorkflowMetadata.State state = 6;</code>
     */
    public int getStateValue() {
      return state_;
    }
    /**
     * <pre>
     * Output only. The workflow state.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.WorkflowMetadata.State state = 6;</code>
     */
    public Builder setStateValue(int value) {
      state_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Output only. The workflow state.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.WorkflowMetadata.State state = 6;</code>
     */
    public com.google.cloud.dataproc.v1beta2.WorkflowMetadata.State getState() {
      @SuppressWarnings("deprecation")
      com.google.cloud.dataproc.v1beta2.WorkflowMetadata.State result = com.google.cloud.dataproc.v1beta2.WorkflowMetadata.State.valueOf(state_);
      return result == null ? com.google.cloud.dataproc.v1beta2.WorkflowMetadata.State.UNRECOGNIZED : result;
    }
    /**
     * <pre>
     * Output only. The workflow state.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.WorkflowMetadata.State state = 6;</code>
     */
    public Builder setState(com.google.cloud.dataproc.v1beta2.WorkflowMetadata.State value) {
      if (value == null) {
        throw new NullPointerException();
      }
      
      state_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Output only. The workflow state.
     * </pre>
     *
     * <code>.google.cloud.dataproc.v1beta2.WorkflowMetadata.State state = 6;</code>
     */
    public Builder clearState() {
      
      state_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object clusterName_ = "";
    /**
     * <pre>
     * Output only. The name of the managed cluster.
     * </pre>
     *
     * <code>string cluster_name = 7;</code>
     */
    public java.lang.String getClusterName() {
      java.lang.Object ref = clusterName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        clusterName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Output only. The name of the managed cluster.
     * </pre>
     *
     * <code>string cluster_name = 7;</code>
     */
    public com.google.protobuf.ByteString
        getClusterNameBytes() {
      java.lang.Object ref = clusterName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        clusterName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Output only. The name of the managed cluster.
     * </pre>
     *
     * <code>string cluster_name = 7;</code>
     */
    public Builder setClusterName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      clusterName_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Output only. The name of the managed cluster.
     * </pre>
     *
     * <code>string cluster_name = 7;</code>
     */
    public Builder clearClusterName() {
      
      clusterName_ = getDefaultInstance().getClusterName();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Output only. The name of the managed cluster.
     * </pre>
     *
     * <code>string cluster_name = 7;</code>
     */
    public Builder setClusterNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      clusterName_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.MapField<
        java.lang.String, java.lang.String> parameters_;
    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
    internalGetParameters() {
      if (parameters_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            ParametersDefaultEntryHolder.defaultEntry);
      }
      return parameters_;
    }
    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
    internalGetMutableParameters() {
      onChanged();;
      if (parameters_ == null) {
        parameters_ = com.google.protobuf.MapField.newMapField(
            ParametersDefaultEntryHolder.defaultEntry);
      }
      if (!parameters_.isMutable()) {
        parameters_ = parameters_.copy();
      }
      return parameters_;
    }

    public int getParametersCount() {
      return internalGetParameters().getMap().size();
    }
    /**
     * <pre>
     * Map from parameter names to values that were used for those parameters.
     * </pre>
     *
     * <code>map&lt;string, string&gt; parameters = 8;</code>
     */

    public boolean containsParameters(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      return internalGetParameters().getMap().containsKey(key);
    }
    /**
     * Use {@link #getParametersMap()} instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getParameters() {
      return getParametersMap();
    }
    /**
     * <pre>
     * Map from parameter names to values that were used for those parameters.
     * </pre>
     *
     * <code>map&lt;string, string&gt; parameters = 8;</code>
     */

    public java.util.Map<java.lang.String, java.lang.String> getParametersMap() {
      return internalGetParameters().getMap();
    }
    /**
     * <pre>
     * Map from parameter names to values that were used for those parameters.
     * </pre>
     *
     * <code>map&lt;string, string&gt; parameters = 8;</code>
     */

    public java.lang.String getParametersOrDefault(
        java.lang.String key,
        java.lang.String defaultValue) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      java.util.Map<java.lang.String, java.lang.String> map =
          internalGetParameters().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * <pre>
     * Map from parameter names to values that were used for those parameters.
     * </pre>
     *
     * <code>map&lt;string, string&gt; parameters = 8;</code>
     */

    public java.lang.String getParametersOrThrow(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      java.util.Map<java.lang.String, java.lang.String> map =
          internalGetParameters().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearParameters() {
      internalGetMutableParameters().getMutableMap()
          .clear();
      return this;
    }
    /**
     * <pre>
     * Map from parameter names to values that were used for those parameters.
     * </pre>
     *
     * <code>map&lt;string, string&gt; parameters = 8;</code>
     */

    public Builder removeParameters(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      internalGetMutableParameters().getMutableMap()
          .remove(key);
      return this;
    }
    /**
     * Use alternate mutation accessors instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String>
    getMutableParameters() {
      return internalGetMutableParameters().getMutableMap();
    }
    /**
     * <pre>
     * Map from parameter names to values that were used for those parameters.
     * </pre>
     *
     * <code>map&lt;string, string&gt; parameters = 8;</code>
     */
    public Builder putParameters(
        java.lang.String key,
        java.lang.String value) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      if (value == null) { throw new java.lang.NullPointerException(); }
      internalGetMutableParameters().getMutableMap()
          .put(key, value);
      return this;
    }
    /**
     * <pre>
     * Map from parameter names to values that were used for those parameters.
     * </pre>
     *
     * <code>map&lt;string, string&gt; parameters = 8;</code>
     */

    public Builder putAllParameters(
        java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableParameters().getMutableMap()
          .putAll(values);
      return this;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

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


    // @@protoc_insertion_point(builder_scope:google.cloud.dataproc.v1beta2.WorkflowMetadata)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.dataproc.v1beta2.WorkflowMetadata)
  private static final com.google.cloud.dataproc.v1beta2.WorkflowMetadata DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.cloud.dataproc.v1beta2.WorkflowMetadata();
  }

  public static com.google.cloud.dataproc.v1beta2.WorkflowMetadata getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

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

}

