// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow/core/protobuf/master.proto

package org.tensorflow.distruntime;

/**
 * Protobuf type {@code tensorflow.RunStepResponse}
 */
public  final class RunStepResponse extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.RunStepResponse)
    RunStepResponseOrBuilder {
  // Use RunStepResponse.newBuilder() to construct.
  private RunStepResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private RunStepResponse() {
    tensor_ = java.util.Collections.emptyList();
    statusCode_ = 0;
    statusErrorMessage_ = "";
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
  }
  private RunStepResponse(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    int mutable_bitField0_ = 0;
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!input.skipField(tag)) {
              done = true;
            }
            break;
          }
          case 10: {
            if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
              tensor_ = new java.util.ArrayList<org.tensorflow.framework.NamedTensorProto>();
              mutable_bitField0_ |= 0x00000001;
            }
            tensor_.add(
                input.readMessage(org.tensorflow.framework.NamedTensorProto.parser(), extensionRegistry));
            break;
          }
          case 18: {
            org.tensorflow.framework.RunMetadata.Builder subBuilder = null;
            if (metadata_ != null) {
              subBuilder = metadata_.toBuilder();
            }
            metadata_ = input.readMessage(org.tensorflow.framework.RunMetadata.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(metadata_);
              metadata_ = subBuilder.buildPartial();
            }

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

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

            statusErrorMessage_ = s;
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
        tensor_ = java.util.Collections.unmodifiableList(tensor_);
      }
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tensorflow.distruntime.DistributedRuntimeProtos.internal_static_tensorflow_RunStepResponse_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tensorflow.distruntime.DistributedRuntimeProtos.internal_static_tensorflow_RunStepResponse_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tensorflow.distruntime.RunStepResponse.class, org.tensorflow.distruntime.RunStepResponse.Builder.class);
  }

  private int bitField0_;
  public static final int TENSOR_FIELD_NUMBER = 1;
  private java.util.List<org.tensorflow.framework.NamedTensorProto> tensor_;
  /**
   * <pre>
   * NOTE: The order of the returned tensors may or may not match
   * the fetch order specified in RunStepRequest.
   * </pre>
   *
   * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
   */
  public java.util.List<org.tensorflow.framework.NamedTensorProto> getTensorList() {
    return tensor_;
  }
  /**
   * <pre>
   * NOTE: The order of the returned tensors may or may not match
   * the fetch order specified in RunStepRequest.
   * </pre>
   *
   * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
   */
  public java.util.List<? extends org.tensorflow.framework.NamedTensorProtoOrBuilder> 
      getTensorOrBuilderList() {
    return tensor_;
  }
  /**
   * <pre>
   * NOTE: The order of the returned tensors may or may not match
   * the fetch order specified in RunStepRequest.
   * </pre>
   *
   * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
   */
  public int getTensorCount() {
    return tensor_.size();
  }
  /**
   * <pre>
   * NOTE: The order of the returned tensors may or may not match
   * the fetch order specified in RunStepRequest.
   * </pre>
   *
   * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
   */
  public org.tensorflow.framework.NamedTensorProto getTensor(int index) {
    return tensor_.get(index);
  }
  /**
   * <pre>
   * NOTE: The order of the returned tensors may or may not match
   * the fetch order specified in RunStepRequest.
   * </pre>
   *
   * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
   */
  public org.tensorflow.framework.NamedTensorProtoOrBuilder getTensorOrBuilder(
      int index) {
    return tensor_.get(index);
  }

  public static final int METADATA_FIELD_NUMBER = 2;
  private org.tensorflow.framework.RunMetadata metadata_;
  /**
   * <pre>
   * Returned metadata if requested in the options.
   * </pre>
   *
   * <code>.tensorflow.RunMetadata metadata = 2;</code>
   */
  public boolean hasMetadata() {
    return metadata_ != null;
  }
  /**
   * <pre>
   * Returned metadata if requested in the options.
   * </pre>
   *
   * <code>.tensorflow.RunMetadata metadata = 2;</code>
   */
  public org.tensorflow.framework.RunMetadata getMetadata() {
    return metadata_ == null ? org.tensorflow.framework.RunMetadata.getDefaultInstance() : metadata_;
  }
  /**
   * <pre>
   * Returned metadata if requested in the options.
   * </pre>
   *
   * <code>.tensorflow.RunMetadata metadata = 2;</code>
   */
  public org.tensorflow.framework.RunMetadataOrBuilder getMetadataOrBuilder() {
    return getMetadata();
  }

  public static final int STATUS_CODE_FIELD_NUMBER = 3;
  private int statusCode_;
  /**
   * <pre>
   * If store_errors_in_response_body is true in the request, then
   * optionally the server may return an OK status for the RPC and
   * fill the true status into the fields below, to allow for messages
   * that are too long to fit in metadata.
   * </pre>
   *
   * <code>.tensorflow.error.Code status_code = 3;</code>
   */
  public int getStatusCodeValue() {
    return statusCode_;
  }
  /**
   * <pre>
   * If store_errors_in_response_body is true in the request, then
   * optionally the server may return an OK status for the RPC and
   * fill the true status into the fields below, to allow for messages
   * that are too long to fit in metadata.
   * </pre>
   *
   * <code>.tensorflow.error.Code status_code = 3;</code>
   */
  public org.tensorflow.framework.Code getStatusCode() {
    org.tensorflow.framework.Code result = org.tensorflow.framework.Code.valueOf(statusCode_);
    return result == null ? org.tensorflow.framework.Code.UNRECOGNIZED : result;
  }

  public static final int STATUS_ERROR_MESSAGE_FIELD_NUMBER = 4;
  private volatile java.lang.Object statusErrorMessage_;
  /**
   * <code>string status_error_message = 4;</code>
   */
  public java.lang.String getStatusErrorMessage() {
    java.lang.Object ref = statusErrorMessage_;
    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();
      statusErrorMessage_ = s;
      return s;
    }
  }
  /**
   * <code>string status_error_message = 4;</code>
   */
  public com.google.protobuf.ByteString
      getStatusErrorMessageBytes() {
    java.lang.Object ref = statusErrorMessage_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      statusErrorMessage_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    for (int i = 0; i < tensor_.size(); i++) {
      output.writeMessage(1, tensor_.get(i));
    }
    if (metadata_ != null) {
      output.writeMessage(2, getMetadata());
    }
    if (statusCode_ != org.tensorflow.framework.Code.OK.getNumber()) {
      output.writeEnum(3, statusCode_);
    }
    if (!getStatusErrorMessageBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, statusErrorMessage_);
    }
  }

  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    for (int i = 0; i < tensor_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(1, tensor_.get(i));
    }
    if (metadata_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(2, getMetadata());
    }
    if (statusCode_ != org.tensorflow.framework.Code.OK.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(3, statusCode_);
    }
    if (!getStatusErrorMessageBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, statusErrorMessage_);
    }
    memoizedSize = size;
    return size;
  }

  private static final long serialVersionUID = 0L;
  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof org.tensorflow.distruntime.RunStepResponse)) {
      return super.equals(obj);
    }
    org.tensorflow.distruntime.RunStepResponse other = (org.tensorflow.distruntime.RunStepResponse) obj;

    boolean result = true;
    result = result && getTensorList()
        .equals(other.getTensorList());
    result = result && (hasMetadata() == other.hasMetadata());
    if (hasMetadata()) {
      result = result && getMetadata()
          .equals(other.getMetadata());
    }
    result = result && statusCode_ == other.statusCode_;
    result = result && getStatusErrorMessage()
        .equals(other.getStatusErrorMessage());
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (getTensorCount() > 0) {
      hash = (37 * hash) + TENSOR_FIELD_NUMBER;
      hash = (53 * hash) + getTensorList().hashCode();
    }
    if (hasMetadata()) {
      hash = (37 * hash) + METADATA_FIELD_NUMBER;
      hash = (53 * hash) + getMetadata().hashCode();
    }
    hash = (37 * hash) + STATUS_CODE_FIELD_NUMBER;
    hash = (53 * hash) + statusCode_;
    hash = (37 * hash) + STATUS_ERROR_MESSAGE_FIELD_NUMBER;
    hash = (53 * hash) + getStatusErrorMessage().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.tensorflow.distruntime.RunStepResponse parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.distruntime.RunStepResponse parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.distruntime.RunStepResponse parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.distruntime.RunStepResponse parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.distruntime.RunStepResponse parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.distruntime.RunStepResponse 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 org.tensorflow.distruntime.RunStepResponse parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.tensorflow.distruntime.RunStepResponse 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 org.tensorflow.distruntime.RunStepResponse parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.distruntime.RunStepResponse parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(org.tensorflow.distruntime.RunStepResponse prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  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;
  }
  /**
   * Protobuf type {@code tensorflow.RunStepResponse}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tensorflow.RunStepResponse)
      org.tensorflow.distruntime.RunStepResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.distruntime.DistributedRuntimeProtos.internal_static_tensorflow_RunStepResponse_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.distruntime.DistributedRuntimeProtos.internal_static_tensorflow_RunStepResponse_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.distruntime.RunStepResponse.class, org.tensorflow.distruntime.RunStepResponse.Builder.class);
    }

    // Construct using org.tensorflow.distruntime.RunStepResponse.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
        getTensorFieldBuilder();
      }
    }
    public Builder clear() {
      super.clear();
      if (tensorBuilder_ == null) {
        tensor_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        tensorBuilder_.clear();
      }
      if (metadataBuilder_ == null) {
        metadata_ = null;
      } else {
        metadata_ = null;
        metadataBuilder_ = null;
      }
      statusCode_ = 0;

      statusErrorMessage_ = "";

      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return org.tensorflow.distruntime.DistributedRuntimeProtos.internal_static_tensorflow_RunStepResponse_descriptor;
    }

    public org.tensorflow.distruntime.RunStepResponse getDefaultInstanceForType() {
      return org.tensorflow.distruntime.RunStepResponse.getDefaultInstance();
    }

    public org.tensorflow.distruntime.RunStepResponse build() {
      org.tensorflow.distruntime.RunStepResponse result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public org.tensorflow.distruntime.RunStepResponse buildPartial() {
      org.tensorflow.distruntime.RunStepResponse result = new org.tensorflow.distruntime.RunStepResponse(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (tensorBuilder_ == null) {
        if (((bitField0_ & 0x00000001) == 0x00000001)) {
          tensor_ = java.util.Collections.unmodifiableList(tensor_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.tensor_ = tensor_;
      } else {
        result.tensor_ = tensorBuilder_.build();
      }
      if (metadataBuilder_ == null) {
        result.metadata_ = metadata_;
      } else {
        result.metadata_ = metadataBuilder_.build();
      }
      result.statusCode_ = statusCode_;
      result.statusErrorMessage_ = statusErrorMessage_;
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    public Builder clone() {
      return (Builder) super.clone();
    }
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return (Builder) super.setField(field, value);
    }
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof org.tensorflow.distruntime.RunStepResponse) {
        return mergeFrom((org.tensorflow.distruntime.RunStepResponse)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tensorflow.distruntime.RunStepResponse other) {
      if (other == org.tensorflow.distruntime.RunStepResponse.getDefaultInstance()) return this;
      if (tensorBuilder_ == null) {
        if (!other.tensor_.isEmpty()) {
          if (tensor_.isEmpty()) {
            tensor_ = other.tensor_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureTensorIsMutable();
            tensor_.addAll(other.tensor_);
          }
          onChanged();
        }
      } else {
        if (!other.tensor_.isEmpty()) {
          if (tensorBuilder_.isEmpty()) {
            tensorBuilder_.dispose();
            tensorBuilder_ = null;
            tensor_ = other.tensor_;
            bitField0_ = (bitField0_ & ~0x00000001);
            tensorBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getTensorFieldBuilder() : null;
          } else {
            tensorBuilder_.addAllMessages(other.tensor_);
          }
        }
      }
      if (other.hasMetadata()) {
        mergeMetadata(other.getMetadata());
      }
      if (other.statusCode_ != 0) {
        setStatusCodeValue(other.getStatusCodeValue());
      }
      if (!other.getStatusErrorMessage().isEmpty()) {
        statusErrorMessage_ = other.statusErrorMessage_;
        onChanged();
      }
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      org.tensorflow.distruntime.RunStepResponse parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tensorflow.distruntime.RunStepResponse) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private java.util.List<org.tensorflow.framework.NamedTensorProto> tensor_ =
      java.util.Collections.emptyList();
    private void ensureTensorIsMutable() {
      if (!((bitField0_ & 0x00000001) == 0x00000001)) {
        tensor_ = new java.util.ArrayList<org.tensorflow.framework.NamedTensorProto>(tensor_);
        bitField0_ |= 0x00000001;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.framework.NamedTensorProto, org.tensorflow.framework.NamedTensorProto.Builder, org.tensorflow.framework.NamedTensorProtoOrBuilder> tensorBuilder_;

    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public java.util.List<org.tensorflow.framework.NamedTensorProto> getTensorList() {
      if (tensorBuilder_ == null) {
        return java.util.Collections.unmodifiableList(tensor_);
      } else {
        return tensorBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public int getTensorCount() {
      if (tensorBuilder_ == null) {
        return tensor_.size();
      } else {
        return tensorBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public org.tensorflow.framework.NamedTensorProto getTensor(int index) {
      if (tensorBuilder_ == null) {
        return tensor_.get(index);
      } else {
        return tensorBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public Builder setTensor(
        int index, org.tensorflow.framework.NamedTensorProto value) {
      if (tensorBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureTensorIsMutable();
        tensor_.set(index, value);
        onChanged();
      } else {
        tensorBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public Builder setTensor(
        int index, org.tensorflow.framework.NamedTensorProto.Builder builderForValue) {
      if (tensorBuilder_ == null) {
        ensureTensorIsMutable();
        tensor_.set(index, builderForValue.build());
        onChanged();
      } else {
        tensorBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public Builder addTensor(org.tensorflow.framework.NamedTensorProto value) {
      if (tensorBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureTensorIsMutable();
        tensor_.add(value);
        onChanged();
      } else {
        tensorBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public Builder addTensor(
        int index, org.tensorflow.framework.NamedTensorProto value) {
      if (tensorBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureTensorIsMutable();
        tensor_.add(index, value);
        onChanged();
      } else {
        tensorBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public Builder addTensor(
        org.tensorflow.framework.NamedTensorProto.Builder builderForValue) {
      if (tensorBuilder_ == null) {
        ensureTensorIsMutable();
        tensor_.add(builderForValue.build());
        onChanged();
      } else {
        tensorBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public Builder addTensor(
        int index, org.tensorflow.framework.NamedTensorProto.Builder builderForValue) {
      if (tensorBuilder_ == null) {
        ensureTensorIsMutable();
        tensor_.add(index, builderForValue.build());
        onChanged();
      } else {
        tensorBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public Builder addAllTensor(
        java.lang.Iterable<? extends org.tensorflow.framework.NamedTensorProto> values) {
      if (tensorBuilder_ == null) {
        ensureTensorIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, tensor_);
        onChanged();
      } else {
        tensorBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public Builder clearTensor() {
      if (tensorBuilder_ == null) {
        tensor_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        tensorBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public Builder removeTensor(int index) {
      if (tensorBuilder_ == null) {
        ensureTensorIsMutable();
        tensor_.remove(index);
        onChanged();
      } else {
        tensorBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public org.tensorflow.framework.NamedTensorProto.Builder getTensorBuilder(
        int index) {
      return getTensorFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public org.tensorflow.framework.NamedTensorProtoOrBuilder getTensorOrBuilder(
        int index) {
      if (tensorBuilder_ == null) {
        return tensor_.get(index);  } else {
        return tensorBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public java.util.List<? extends org.tensorflow.framework.NamedTensorProtoOrBuilder> 
         getTensorOrBuilderList() {
      if (tensorBuilder_ != null) {
        return tensorBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(tensor_);
      }
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public org.tensorflow.framework.NamedTensorProto.Builder addTensorBuilder() {
      return getTensorFieldBuilder().addBuilder(
          org.tensorflow.framework.NamedTensorProto.getDefaultInstance());
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public org.tensorflow.framework.NamedTensorProto.Builder addTensorBuilder(
        int index) {
      return getTensorFieldBuilder().addBuilder(
          index, org.tensorflow.framework.NamedTensorProto.getDefaultInstance());
    }
    /**
     * <pre>
     * NOTE: The order of the returned tensors may or may not match
     * the fetch order specified in RunStepRequest.
     * </pre>
     *
     * <code>repeated .tensorflow.NamedTensorProto tensor = 1;</code>
     */
    public java.util.List<org.tensorflow.framework.NamedTensorProto.Builder> 
         getTensorBuilderList() {
      return getTensorFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.framework.NamedTensorProto, org.tensorflow.framework.NamedTensorProto.Builder, org.tensorflow.framework.NamedTensorProtoOrBuilder> 
        getTensorFieldBuilder() {
      if (tensorBuilder_ == null) {
        tensorBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            org.tensorflow.framework.NamedTensorProto, org.tensorflow.framework.NamedTensorProto.Builder, org.tensorflow.framework.NamedTensorProtoOrBuilder>(
                tensor_,
                ((bitField0_ & 0x00000001) == 0x00000001),
                getParentForChildren(),
                isClean());
        tensor_ = null;
      }
      return tensorBuilder_;
    }

    private org.tensorflow.framework.RunMetadata metadata_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.framework.RunMetadata, org.tensorflow.framework.RunMetadata.Builder, org.tensorflow.framework.RunMetadataOrBuilder> metadataBuilder_;
    /**
     * <pre>
     * Returned metadata if requested in the options.
     * </pre>
     *
     * <code>.tensorflow.RunMetadata metadata = 2;</code>
     */
    public boolean hasMetadata() {
      return metadataBuilder_ != null || metadata_ != null;
    }
    /**
     * <pre>
     * Returned metadata if requested in the options.
     * </pre>
     *
     * <code>.tensorflow.RunMetadata metadata = 2;</code>
     */
    public org.tensorflow.framework.RunMetadata getMetadata() {
      if (metadataBuilder_ == null) {
        return metadata_ == null ? org.tensorflow.framework.RunMetadata.getDefaultInstance() : metadata_;
      } else {
        return metadataBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Returned metadata if requested in the options.
     * </pre>
     *
     * <code>.tensorflow.RunMetadata metadata = 2;</code>
     */
    public Builder setMetadata(org.tensorflow.framework.RunMetadata value) {
      if (metadataBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        metadata_ = value;
        onChanged();
      } else {
        metadataBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Returned metadata if requested in the options.
     * </pre>
     *
     * <code>.tensorflow.RunMetadata metadata = 2;</code>
     */
    public Builder setMetadata(
        org.tensorflow.framework.RunMetadata.Builder builderForValue) {
      if (metadataBuilder_ == null) {
        metadata_ = builderForValue.build();
        onChanged();
      } else {
        metadataBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Returned metadata if requested in the options.
     * </pre>
     *
     * <code>.tensorflow.RunMetadata metadata = 2;</code>
     */
    public Builder mergeMetadata(org.tensorflow.framework.RunMetadata value) {
      if (metadataBuilder_ == null) {
        if (metadata_ != null) {
          metadata_ =
            org.tensorflow.framework.RunMetadata.newBuilder(metadata_).mergeFrom(value).buildPartial();
        } else {
          metadata_ = value;
        }
        onChanged();
      } else {
        metadataBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Returned metadata if requested in the options.
     * </pre>
     *
     * <code>.tensorflow.RunMetadata metadata = 2;</code>
     */
    public Builder clearMetadata() {
      if (metadataBuilder_ == null) {
        metadata_ = null;
        onChanged();
      } else {
        metadata_ = null;
        metadataBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Returned metadata if requested in the options.
     * </pre>
     *
     * <code>.tensorflow.RunMetadata metadata = 2;</code>
     */
    public org.tensorflow.framework.RunMetadata.Builder getMetadataBuilder() {
      
      onChanged();
      return getMetadataFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Returned metadata if requested in the options.
     * </pre>
     *
     * <code>.tensorflow.RunMetadata metadata = 2;</code>
     */
    public org.tensorflow.framework.RunMetadataOrBuilder getMetadataOrBuilder() {
      if (metadataBuilder_ != null) {
        return metadataBuilder_.getMessageOrBuilder();
      } else {
        return metadata_ == null ?
            org.tensorflow.framework.RunMetadata.getDefaultInstance() : metadata_;
      }
    }
    /**
     * <pre>
     * Returned metadata if requested in the options.
     * </pre>
     *
     * <code>.tensorflow.RunMetadata metadata = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.framework.RunMetadata, org.tensorflow.framework.RunMetadata.Builder, org.tensorflow.framework.RunMetadataOrBuilder> 
        getMetadataFieldBuilder() {
      if (metadataBuilder_ == null) {
        metadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tensorflow.framework.RunMetadata, org.tensorflow.framework.RunMetadata.Builder, org.tensorflow.framework.RunMetadataOrBuilder>(
                getMetadata(),
                getParentForChildren(),
                isClean());
        metadata_ = null;
      }
      return metadataBuilder_;
    }

    private int statusCode_ = 0;
    /**
     * <pre>
     * If store_errors_in_response_body is true in the request, then
     * optionally the server may return an OK status for the RPC and
     * fill the true status into the fields below, to allow for messages
     * that are too long to fit in metadata.
     * </pre>
     *
     * <code>.tensorflow.error.Code status_code = 3;</code>
     */
    public int getStatusCodeValue() {
      return statusCode_;
    }
    /**
     * <pre>
     * If store_errors_in_response_body is true in the request, then
     * optionally the server may return an OK status for the RPC and
     * fill the true status into the fields below, to allow for messages
     * that are too long to fit in metadata.
     * </pre>
     *
     * <code>.tensorflow.error.Code status_code = 3;</code>
     */
    public Builder setStatusCodeValue(int value) {
      statusCode_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * If store_errors_in_response_body is true in the request, then
     * optionally the server may return an OK status for the RPC and
     * fill the true status into the fields below, to allow for messages
     * that are too long to fit in metadata.
     * </pre>
     *
     * <code>.tensorflow.error.Code status_code = 3;</code>
     */
    public org.tensorflow.framework.Code getStatusCode() {
      org.tensorflow.framework.Code result = org.tensorflow.framework.Code.valueOf(statusCode_);
      return result == null ? org.tensorflow.framework.Code.UNRECOGNIZED : result;
    }
    /**
     * <pre>
     * If store_errors_in_response_body is true in the request, then
     * optionally the server may return an OK status for the RPC and
     * fill the true status into the fields below, to allow for messages
     * that are too long to fit in metadata.
     * </pre>
     *
     * <code>.tensorflow.error.Code status_code = 3;</code>
     */
    public Builder setStatusCode(org.tensorflow.framework.Code value) {
      if (value == null) {
        throw new NullPointerException();
      }
      
      statusCode_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * If store_errors_in_response_body is true in the request, then
     * optionally the server may return an OK status for the RPC and
     * fill the true status into the fields below, to allow for messages
     * that are too long to fit in metadata.
     * </pre>
     *
     * <code>.tensorflow.error.Code status_code = 3;</code>
     */
    public Builder clearStatusCode() {
      
      statusCode_ = 0;
      onChanged();
      return this;
    }

    private java.lang.Object statusErrorMessage_ = "";
    /**
     * <code>string status_error_message = 4;</code>
     */
    public java.lang.String getStatusErrorMessage() {
      java.lang.Object ref = statusErrorMessage_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        statusErrorMessage_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <code>string status_error_message = 4;</code>
     */
    public com.google.protobuf.ByteString
        getStatusErrorMessageBytes() {
      java.lang.Object ref = statusErrorMessage_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        statusErrorMessage_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <code>string status_error_message = 4;</code>
     */
    public Builder setStatusErrorMessage(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      statusErrorMessage_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>string status_error_message = 4;</code>
     */
    public Builder clearStatusErrorMessage() {
      
      statusErrorMessage_ = getDefaultInstance().getStatusErrorMessage();
      onChanged();
      return this;
    }
    /**
     * <code>string status_error_message = 4;</code>
     */
    public Builder setStatusErrorMessageBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      statusErrorMessage_ = value;
      onChanged();
      return this;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return this;
    }

    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return this;
    }


    // @@protoc_insertion_point(builder_scope:tensorflow.RunStepResponse)
  }

  // @@protoc_insertion_point(class_scope:tensorflow.RunStepResponse)
  private static final org.tensorflow.distruntime.RunStepResponse DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new org.tensorflow.distruntime.RunStepResponse();
  }

  public static org.tensorflow.distruntime.RunStepResponse getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  public org.tensorflow.distruntime.RunStepResponse getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

