// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: mcp.proto

package com.alibaba.nacos.istio.model.mcp;

/**
 * <pre>
 * A RequestResource can be sent in two situations:
 * Initial message in an MCP bidirectional change stream
 * as an ACK or NACK response to a previous Resources. In
 * this case the response_nonce is set to the nonce value
 * in the Resources. ACK/NACK is determined by the presence
 * of error_detail.
 * * ACK  (nonce!="",error_details==nil)
 * * NACK (nonce!="",error_details!=nil)
 * * New/Update request (nonce=="",error_details ignored)
 * </pre>
 *
 * Protobuf type {@code istio.mcp.v1alpha1.RequestResources}
 */
public  final class RequestResources extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:istio.mcp.v1alpha1.RequestResources)
    RequestResourcesOrBuilder {
private static final long serialVersionUID = 0L;
  // Use RequestResources.newBuilder() to construct.
  private RequestResources(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private RequestResources() {
    collection_ = "";
    responseNonce_ = "";
  }

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

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private RequestResources(
      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: {
            com.alibaba.nacos.istio.model.mcp.SinkNode.Builder subBuilder = null;
            if (sinkNode_ != null) {
              subBuilder = sinkNode_.toBuilder();
            }
            sinkNode_ = input.readMessage(com.alibaba.nacos.istio.model.mcp.SinkNode.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(sinkNode_);
              sinkNode_ = subBuilder.buildPartial();
            }

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

            collection_ = s;
            break;
          }
          case 26: {
            if (!((mutable_bitField0_ & 0x00000001) != 0)) {
              initialResourceVersions_ = com.google.protobuf.MapField.newMapField(
                  InitialResourceVersionsDefaultEntryHolder.defaultEntry);
              mutable_bitField0_ |= 0x00000001;
            }
            com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
            initialResourceVersions__ = input.readMessage(
                InitialResourceVersionsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
            initialResourceVersions_.getMutableMap().put(
                initialResourceVersions__.getKey(), initialResourceVersions__.getValue());
            break;
          }
          case 34: {
            java.lang.String s = input.readStringRequireUtf8();

            responseNonce_ = s;
            break;
          }
          case 42: {
            com.google.rpc.Status.Builder subBuilder = null;
            if (errorDetail_ != null) {
              subBuilder = errorDetail_.toBuilder();
            }
            errorDetail_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(errorDetail_);
              errorDetail_ = subBuilder.buildPartial();
            }

            break;
          }
          case 48: {

            incremental_ = input.readBool();
            break;
          }
          default: {
            if (!parseUnknownField(
                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.alibaba.nacos.istio.model.mcp.Mcp.internal_static_istio_mcp_v1alpha1_RequestResources_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapField internalGetMapField(
      int number) {
    switch (number) {
      case 3:
        return internalGetInitialResourceVersions();
      default:
        throw new RuntimeException(
            "Invalid map field number: " + number);
    }
  }
  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.alibaba.nacos.istio.model.mcp.Mcp.internal_static_istio_mcp_v1alpha1_RequestResources_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.alibaba.nacos.istio.model.mcp.RequestResources.class, com.alibaba.nacos.istio.model.mcp.RequestResources.Builder.class);
  }

  public static final int SINK_NODE_FIELD_NUMBER = 1;
  private com.alibaba.nacos.istio.model.mcp.SinkNode sinkNode_;
  /**
   * <pre>
   * The sink node making the request.
   * </pre>
   *
   * <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
   * @return Whether the sinkNode field is set.
   */
  public boolean hasSinkNode() {
    return sinkNode_ != null;
  }
  /**
   * <pre>
   * The sink node making the request.
   * </pre>
   *
   * <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
   * @return The sinkNode.
   */
  public com.alibaba.nacos.istio.model.mcp.SinkNode getSinkNode() {
    return sinkNode_ == null ? com.alibaba.nacos.istio.model.mcp.SinkNode.getDefaultInstance() : sinkNode_;
  }
  /**
   * <pre>
   * The sink node making the request.
   * </pre>
   *
   * <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
   */
  public com.alibaba.nacos.istio.model.mcp.SinkNodeOrBuilder getSinkNodeOrBuilder() {
    return getSinkNode();
  }

  public static final int COLLECTION_FIELD_NUMBER = 2;
  private volatile java.lang.Object collection_;
  /**
   * <pre>
   * Type of resource collection that is being requested, e.g.
   * istio/networking/v1alpha3/VirtualService
   * k8s/&lt;apiVersion&gt;/&lt;kind&gt;
   * </pre>
   *
   * <code>string collection = 2;</code>
   * @return The collection.
   */
  public java.lang.String getCollection() {
    java.lang.Object ref = collection_;
    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();
      collection_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Type of resource collection that is being requested, e.g.
   * istio/networking/v1alpha3/VirtualService
   * k8s/&lt;apiVersion&gt;/&lt;kind&gt;
   * </pre>
   *
   * <code>string collection = 2;</code>
   * @return The bytes for collection.
   */
  public com.google.protobuf.ByteString
      getCollectionBytes() {
    java.lang.Object ref = collection_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      collection_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int INITIAL_RESOURCE_VERSIONS_FIELD_NUMBER = 3;
  private static final class InitialResourceVersionsDefaultEntryHolder {
    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.alibaba.nacos.istio.model.mcp.Mcp.internal_static_istio_mcp_v1alpha1_RequestResources_InitialResourceVersionsEntry_descriptor, 
                com.google.protobuf.WireFormat.FieldType.STRING,
                "",
                com.google.protobuf.WireFormat.FieldType.STRING,
                "");
  }
  private com.google.protobuf.MapField<
      java.lang.String, java.lang.String> initialResourceVersions_;
  private com.google.protobuf.MapField<java.lang.String, java.lang.String>
  internalGetInitialResourceVersions() {
    if (initialResourceVersions_ == null) {
      return com.google.protobuf.MapField.emptyMapField(
          InitialResourceVersionsDefaultEntryHolder.defaultEntry);
    }
    return initialResourceVersions_;
  }

  public int getInitialResourceVersionsCount() {
    return internalGetInitialResourceVersions().getMap().size();
  }
  /**
   * <pre>
   * When the RequestResources is the first in a stream, the initial_resource_versions must
   * be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
   * resources names of the MCP resources known to the MCP client. The values in the map
   * are the associated resource level version info.
   * </pre>
   *
   * <code>map&lt;string, string&gt; initial_resource_versions = 3;</code>
   */

  public boolean containsInitialResourceVersions(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    return internalGetInitialResourceVersions().getMap().containsKey(key);
  }
  /**
   * Use {@link #getInitialResourceVersionsMap()} instead.
   */
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getInitialResourceVersions() {
    return getInitialResourceVersionsMap();
  }
  /**
   * <pre>
   * When the RequestResources is the first in a stream, the initial_resource_versions must
   * be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
   * resources names of the MCP resources known to the MCP client. The values in the map
   * are the associated resource level version info.
   * </pre>
   *
   * <code>map&lt;string, string&gt; initial_resource_versions = 3;</code>
   */

  public java.util.Map<java.lang.String, java.lang.String> getInitialResourceVersionsMap() {
    return internalGetInitialResourceVersions().getMap();
  }
  /**
   * <pre>
   * When the RequestResources is the first in a stream, the initial_resource_versions must
   * be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
   * resources names of the MCP resources known to the MCP client. The values in the map
   * are the associated resource level version info.
   * </pre>
   *
   * <code>map&lt;string, string&gt; initial_resource_versions = 3;</code>
   */

  public java.lang.String getInitialResourceVersionsOrDefault(
      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 =
        internalGetInitialResourceVersions().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   * <pre>
   * When the RequestResources is the first in a stream, the initial_resource_versions must
   * be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
   * resources names of the MCP resources known to the MCP client. The values in the map
   * are the associated resource level version info.
   * </pre>
   *
   * <code>map&lt;string, string&gt; initial_resource_versions = 3;</code>
   */

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

  public static final int RESPONSE_NONCE_FIELD_NUMBER = 4;
  private volatile java.lang.Object responseNonce_;
  /**
   * <pre>
   * When the RequestResources is an ACK or NACK message in response to a previous RequestResources,
   * the response_nonce must be the nonce in the RequestResources. Otherwise response_nonce must
   * be omitted.
   * </pre>
   *
   * <code>string response_nonce = 4;</code>
   * @return The responseNonce.
   */
  public java.lang.String getResponseNonce() {
    java.lang.Object ref = responseNonce_;
    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();
      responseNonce_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * When the RequestResources is an ACK or NACK message in response to a previous RequestResources,
   * the response_nonce must be the nonce in the RequestResources. Otherwise response_nonce must
   * be omitted.
   * </pre>
   *
   * <code>string response_nonce = 4;</code>
   * @return The bytes for responseNonce.
   */
  public com.google.protobuf.ByteString
      getResponseNonceBytes() {
    java.lang.Object ref = responseNonce_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      responseNonce_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int ERROR_DETAIL_FIELD_NUMBER = 5;
  private com.google.rpc.Status errorDetail_;
  /**
   * <pre>
   * This is populated when the previously received resources could not be applied
   * The *message* field in *error_details* provides the source internal error
   * related to the failure.
   * </pre>
   *
   * <code>.google.rpc.Status error_detail = 5;</code>
   * @return Whether the errorDetail field is set.
   */
  public boolean hasErrorDetail() {
    return errorDetail_ != null;
  }
  /**
   * <pre>
   * This is populated when the previously received resources could not be applied
   * The *message* field in *error_details* provides the source internal error
   * related to the failure.
   * </pre>
   *
   * <code>.google.rpc.Status error_detail = 5;</code>
   * @return The errorDetail.
   */
  public com.google.rpc.Status getErrorDetail() {
    return errorDetail_ == null ? com.google.rpc.Status.getDefaultInstance() : errorDetail_;
  }
  /**
   * <pre>
   * This is populated when the previously received resources could not be applied
   * The *message* field in *error_details* provides the source internal error
   * related to the failure.
   * </pre>
   *
   * <code>.google.rpc.Status error_detail = 5;</code>
   */
  public com.google.rpc.StatusOrBuilder getErrorDetailOrBuilder() {
    return getErrorDetail();
  }

  public static final int INCREMENTAL_FIELD_NUMBER = 6;
  private boolean incremental_;
  /**
   * <pre>
   * Request an incremental update for the specified collection. The source may choose to
   * honor this request or ignore and and provide a full-state update in the corresponding
   * `Resource` response.
   * </pre>
   *
   * <code>bool incremental = 6;</code>
   * @return The incremental.
   */
  public boolean getIncremental() {
    return incremental_;
  }

  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 (sinkNode_ != null) {
      output.writeMessage(1, getSinkNode());
    }
    if (!getCollectionBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, collection_);
    }
    com.google.protobuf.GeneratedMessageV3
      .serializeStringMapTo(
        output,
        internalGetInitialResourceVersions(),
        InitialResourceVersionsDefaultEntryHolder.defaultEntry,
        3);
    if (!getResponseNonceBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, responseNonce_);
    }
    if (errorDetail_ != null) {
      output.writeMessage(5, getErrorDetail());
    }
    if (incremental_ != false) {
      output.writeBool(6, incremental_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (sinkNode_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(1, getSinkNode());
    }
    if (!getCollectionBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, collection_);
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry
         : internalGetInitialResourceVersions().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
      initialResourceVersions__ = InitialResourceVersionsDefaultEntryHolder.defaultEntry.newBuilderForType()
          .setKey(entry.getKey())
          .setValue(entry.getValue())
          .build();
      size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(3, initialResourceVersions__);
    }
    if (!getResponseNonceBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, responseNonce_);
    }
    if (errorDetail_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, getErrorDetail());
    }
    if (incremental_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(6, incremental_);
    }
    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.alibaba.nacos.istio.model.mcp.RequestResources)) {
      return super.equals(obj);
    }
    com.alibaba.nacos.istio.model.mcp.RequestResources other = (com.alibaba.nacos.istio.model.mcp.RequestResources) obj;

    if (hasSinkNode() != other.hasSinkNode()) return false;
    if (hasSinkNode()) {
      if (!getSinkNode()
          .equals(other.getSinkNode())) return false;
    }
    if (!getCollection()
        .equals(other.getCollection())) return false;
    if (!internalGetInitialResourceVersions().equals(
        other.internalGetInitialResourceVersions())) return false;
    if (!getResponseNonce()
        .equals(other.getResponseNonce())) return false;
    if (hasErrorDetail() != other.hasErrorDetail()) return false;
    if (hasErrorDetail()) {
      if (!getErrorDetail()
          .equals(other.getErrorDetail())) return false;
    }
    if (getIncremental()
        != other.getIncremental()) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasSinkNode()) {
      hash = (37 * hash) + SINK_NODE_FIELD_NUMBER;
      hash = (53 * hash) + getSinkNode().hashCode();
    }
    hash = (37 * hash) + COLLECTION_FIELD_NUMBER;
    hash = (53 * hash) + getCollection().hashCode();
    if (!internalGetInitialResourceVersions().getMap().isEmpty()) {
      hash = (37 * hash) + INITIAL_RESOURCE_VERSIONS_FIELD_NUMBER;
      hash = (53 * hash) + internalGetInitialResourceVersions().hashCode();
    }
    hash = (37 * hash) + RESPONSE_NONCE_FIELD_NUMBER;
    hash = (53 * hash) + getResponseNonce().hashCode();
    if (hasErrorDetail()) {
      hash = (37 * hash) + ERROR_DETAIL_FIELD_NUMBER;
      hash = (53 * hash) + getErrorDetail().hashCode();
    }
    hash = (37 * hash) + INCREMENTAL_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getIncremental());
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.alibaba.nacos.istio.model.mcp.RequestResources parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.alibaba.nacos.istio.model.mcp.RequestResources parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.alibaba.nacos.istio.model.mcp.RequestResources parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.alibaba.nacos.istio.model.mcp.RequestResources parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.alibaba.nacos.istio.model.mcp.RequestResources parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.alibaba.nacos.istio.model.mcp.RequestResources parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.alibaba.nacos.istio.model.mcp.RequestResources parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.alibaba.nacos.istio.model.mcp.RequestResources 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.alibaba.nacos.istio.model.mcp.RequestResources parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.alibaba.nacos.istio.model.mcp.RequestResources 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.alibaba.nacos.istio.model.mcp.RequestResources parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.alibaba.nacos.istio.model.mcp.RequestResources 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.alibaba.nacos.istio.model.mcp.RequestResources 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 RequestResource can be sent in two situations:
   * Initial message in an MCP bidirectional change stream
   * as an ACK or NACK response to a previous Resources. In
   * this case the response_nonce is set to the nonce value
   * in the Resources. ACK/NACK is determined by the presence
   * of error_detail.
   * * ACK  (nonce!="",error_details==nil)
   * * NACK (nonce!="",error_details!=nil)
   * * New/Update request (nonce=="",error_details ignored)
   * </pre>
   *
   * Protobuf type {@code istio.mcp.v1alpha1.RequestResources}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:istio.mcp.v1alpha1.RequestResources)
      com.alibaba.nacos.istio.model.mcp.RequestResourcesOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.alibaba.nacos.istio.model.mcp.Mcp.internal_static_istio_mcp_v1alpha1_RequestResources_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(
        int number) {
      switch (number) {
        case 3:
          return internalGetInitialResourceVersions();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(
        int number) {
      switch (number) {
        case 3:
          return internalGetMutableInitialResourceVersions();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.alibaba.nacos.istio.model.mcp.Mcp.internal_static_istio_mcp_v1alpha1_RequestResources_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.alibaba.nacos.istio.model.mcp.RequestResources.class, com.alibaba.nacos.istio.model.mcp.RequestResources.Builder.class);
    }

    // Construct using com.alibaba.nacos.istio.model.mcp.RequestResources.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();
      if (sinkNodeBuilder_ == null) {
        sinkNode_ = null;
      } else {
        sinkNode_ = null;
        sinkNodeBuilder_ = null;
      }
      collection_ = "";

      internalGetMutableInitialResourceVersions().clear();
      responseNonce_ = "";

      if (errorDetailBuilder_ == null) {
        errorDetail_ = null;
      } else {
        errorDetail_ = null;
        errorDetailBuilder_ = null;
      }
      incremental_ = false;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.alibaba.nacos.istio.model.mcp.Mcp.internal_static_istio_mcp_v1alpha1_RequestResources_descriptor;
    }

    @java.lang.Override
    public com.alibaba.nacos.istio.model.mcp.RequestResources getDefaultInstanceForType() {
      return com.alibaba.nacos.istio.model.mcp.RequestResources.getDefaultInstance();
    }

    @java.lang.Override
    public com.alibaba.nacos.istio.model.mcp.RequestResources build() {
      com.alibaba.nacos.istio.model.mcp.RequestResources result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.alibaba.nacos.istio.model.mcp.RequestResources buildPartial() {
      com.alibaba.nacos.istio.model.mcp.RequestResources result = new com.alibaba.nacos.istio.model.mcp.RequestResources(this);
      int from_bitField0_ = bitField0_;
      if (sinkNodeBuilder_ == null) {
        result.sinkNode_ = sinkNode_;
      } else {
        result.sinkNode_ = sinkNodeBuilder_.build();
      }
      result.collection_ = collection_;
      result.initialResourceVersions_ = internalGetInitialResourceVersions();
      result.initialResourceVersions_.makeImmutable();
      result.responseNonce_ = responseNonce_;
      if (errorDetailBuilder_ == null) {
        result.errorDetail_ = errorDetail_;
      } else {
        result.errorDetail_ = errorDetailBuilder_.build();
      }
      result.incremental_ = incremental_;
      onBuilt();
      return result;
    }

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

    public Builder mergeFrom(com.alibaba.nacos.istio.model.mcp.RequestResources other) {
      if (other == com.alibaba.nacos.istio.model.mcp.RequestResources.getDefaultInstance()) return this;
      if (other.hasSinkNode()) {
        mergeSinkNode(other.getSinkNode());
      }
      if (!other.getCollection().isEmpty()) {
        collection_ = other.collection_;
        onChanged();
      }
      internalGetMutableInitialResourceVersions().mergeFrom(
          other.internalGetInitialResourceVersions());
      if (!other.getResponseNonce().isEmpty()) {
        responseNonce_ = other.responseNonce_;
        onChanged();
      }
      if (other.hasErrorDetail()) {
        mergeErrorDetail(other.getErrorDetail());
      }
      if (other.getIncremental() != false) {
        setIncremental(other.getIncremental());
      }
      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.alibaba.nacos.istio.model.mcp.RequestResources parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.alibaba.nacos.istio.model.mcp.RequestResources) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private com.alibaba.nacos.istio.model.mcp.SinkNode sinkNode_;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.alibaba.nacos.istio.model.mcp.SinkNode, com.alibaba.nacos.istio.model.mcp.SinkNode.Builder, com.alibaba.nacos.istio.model.mcp.SinkNodeOrBuilder> sinkNodeBuilder_;
    /**
     * <pre>
     * The sink node making the request.
     * </pre>
     *
     * <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
     * @return Whether the sinkNode field is set.
     */
    public boolean hasSinkNode() {
      return sinkNodeBuilder_ != null || sinkNode_ != null;
    }
    /**
     * <pre>
     * The sink node making the request.
     * </pre>
     *
     * <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
     * @return The sinkNode.
     */
    public com.alibaba.nacos.istio.model.mcp.SinkNode getSinkNode() {
      if (sinkNodeBuilder_ == null) {
        return sinkNode_ == null ? com.alibaba.nacos.istio.model.mcp.SinkNode.getDefaultInstance() : sinkNode_;
      } else {
        return sinkNodeBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The sink node making the request.
     * </pre>
     *
     * <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
     */
    public Builder setSinkNode(com.alibaba.nacos.istio.model.mcp.SinkNode value) {
      if (sinkNodeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        sinkNode_ = value;
        onChanged();
      } else {
        sinkNodeBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * The sink node making the request.
     * </pre>
     *
     * <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
     */
    public Builder setSinkNode(
        com.alibaba.nacos.istio.model.mcp.SinkNode.Builder builderForValue) {
      if (sinkNodeBuilder_ == null) {
        sinkNode_ = builderForValue.build();
        onChanged();
      } else {
        sinkNodeBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * The sink node making the request.
     * </pre>
     *
     * <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
     */
    public Builder mergeSinkNode(com.alibaba.nacos.istio.model.mcp.SinkNode value) {
      if (sinkNodeBuilder_ == null) {
        if (sinkNode_ != null) {
          sinkNode_ =
            com.alibaba.nacos.istio.model.mcp.SinkNode.newBuilder(sinkNode_).mergeFrom(value).buildPartial();
        } else {
          sinkNode_ = value;
        }
        onChanged();
      } else {
        sinkNodeBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * The sink node making the request.
     * </pre>
     *
     * <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
     */
    public Builder clearSinkNode() {
      if (sinkNodeBuilder_ == null) {
        sinkNode_ = null;
        onChanged();
      } else {
        sinkNode_ = null;
        sinkNodeBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * The sink node making the request.
     * </pre>
     *
     * <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
     */
    public com.alibaba.nacos.istio.model.mcp.SinkNode.Builder getSinkNodeBuilder() {
      
      onChanged();
      return getSinkNodeFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The sink node making the request.
     * </pre>
     *
     * <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
     */
    public com.alibaba.nacos.istio.model.mcp.SinkNodeOrBuilder getSinkNodeOrBuilder() {
      if (sinkNodeBuilder_ != null) {
        return sinkNodeBuilder_.getMessageOrBuilder();
      } else {
        return sinkNode_ == null ?
            com.alibaba.nacos.istio.model.mcp.SinkNode.getDefaultInstance() : sinkNode_;
      }
    }
    /**
     * <pre>
     * The sink node making the request.
     * </pre>
     *
     * <code>.istio.mcp.v1alpha1.SinkNode sink_node = 1;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.alibaba.nacos.istio.model.mcp.SinkNode, com.alibaba.nacos.istio.model.mcp.SinkNode.Builder, com.alibaba.nacos.istio.model.mcp.SinkNodeOrBuilder> 
        getSinkNodeFieldBuilder() {
      if (sinkNodeBuilder_ == null) {
        sinkNodeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.alibaba.nacos.istio.model.mcp.SinkNode, com.alibaba.nacos.istio.model.mcp.SinkNode.Builder, com.alibaba.nacos.istio.model.mcp.SinkNodeOrBuilder>(
                getSinkNode(),
                getParentForChildren(),
                isClean());
        sinkNode_ = null;
      }
      return sinkNodeBuilder_;
    }

    private java.lang.Object collection_ = "";
    /**
     * <pre>
     * Type of resource collection that is being requested, e.g.
     * istio/networking/v1alpha3/VirtualService
     * k8s/&lt;apiVersion&gt;/&lt;kind&gt;
     * </pre>
     *
     * <code>string collection = 2;</code>
     * @return The collection.
     */
    public java.lang.String getCollection() {
      java.lang.Object ref = collection_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        collection_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Type of resource collection that is being requested, e.g.
     * istio/networking/v1alpha3/VirtualService
     * k8s/&lt;apiVersion&gt;/&lt;kind&gt;
     * </pre>
     *
     * <code>string collection = 2;</code>
     * @return The bytes for collection.
     */
    public com.google.protobuf.ByteString
        getCollectionBytes() {
      java.lang.Object ref = collection_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        collection_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Type of resource collection that is being requested, e.g.
     * istio/networking/v1alpha3/VirtualService
     * k8s/&lt;apiVersion&gt;/&lt;kind&gt;
     * </pre>
     *
     * <code>string collection = 2;</code>
     * @param value The collection to set.
     * @return This builder for chaining.
     */
    public Builder setCollection(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      collection_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Type of resource collection that is being requested, e.g.
     * istio/networking/v1alpha3/VirtualService
     * k8s/&lt;apiVersion&gt;/&lt;kind&gt;
     * </pre>
     *
     * <code>string collection = 2;</code>
     * @return This builder for chaining.
     */
    public Builder clearCollection() {
      
      collection_ = getDefaultInstance().getCollection();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Type of resource collection that is being requested, e.g.
     * istio/networking/v1alpha3/VirtualService
     * k8s/&lt;apiVersion&gt;/&lt;kind&gt;
     * </pre>
     *
     * <code>string collection = 2;</code>
     * @param value The bytes for collection to set.
     * @return This builder for chaining.
     */
    public Builder setCollectionBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      collection_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.MapField<
        java.lang.String, java.lang.String> initialResourceVersions_;
    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
    internalGetInitialResourceVersions() {
      if (initialResourceVersions_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            InitialResourceVersionsDefaultEntryHolder.defaultEntry);
      }
      return initialResourceVersions_;
    }
    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
    internalGetMutableInitialResourceVersions() {
      onChanged();;
      if (initialResourceVersions_ == null) {
        initialResourceVersions_ = com.google.protobuf.MapField.newMapField(
            InitialResourceVersionsDefaultEntryHolder.defaultEntry);
      }
      if (!initialResourceVersions_.isMutable()) {
        initialResourceVersions_ = initialResourceVersions_.copy();
      }
      return initialResourceVersions_;
    }

    public int getInitialResourceVersionsCount() {
      return internalGetInitialResourceVersions().getMap().size();
    }
    /**
     * <pre>
     * When the RequestResources is the first in a stream, the initial_resource_versions must
     * be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
     * resources names of the MCP resources known to the MCP client. The values in the map
     * are the associated resource level version info.
     * </pre>
     *
     * <code>map&lt;string, string&gt; initial_resource_versions = 3;</code>
     */

    public boolean containsInitialResourceVersions(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      return internalGetInitialResourceVersions().getMap().containsKey(key);
    }
    /**
     * Use {@link #getInitialResourceVersionsMap()} instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getInitialResourceVersions() {
      return getInitialResourceVersionsMap();
    }
    /**
     * <pre>
     * When the RequestResources is the first in a stream, the initial_resource_versions must
     * be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
     * resources names of the MCP resources known to the MCP client. The values in the map
     * are the associated resource level version info.
     * </pre>
     *
     * <code>map&lt;string, string&gt; initial_resource_versions = 3;</code>
     */

    public java.util.Map<java.lang.String, java.lang.String> getInitialResourceVersionsMap() {
      return internalGetInitialResourceVersions().getMap();
    }
    /**
     * <pre>
     * When the RequestResources is the first in a stream, the initial_resource_versions must
     * be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
     * resources names of the MCP resources known to the MCP client. The values in the map
     * are the associated resource level version info.
     * </pre>
     *
     * <code>map&lt;string, string&gt; initial_resource_versions = 3;</code>
     */

    public java.lang.String getInitialResourceVersionsOrDefault(
        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 =
          internalGetInitialResourceVersions().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * <pre>
     * When the RequestResources is the first in a stream, the initial_resource_versions must
     * be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
     * resources names of the MCP resources known to the MCP client. The values in the map
     * are the associated resource level version info.
     * </pre>
     *
     * <code>map&lt;string, string&gt; initial_resource_versions = 3;</code>
     */

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

    public Builder clearInitialResourceVersions() {
      internalGetMutableInitialResourceVersions().getMutableMap()
          .clear();
      return this;
    }
    /**
     * <pre>
     * When the RequestResources is the first in a stream, the initial_resource_versions must
     * be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
     * resources names of the MCP resources known to the MCP client. The values in the map
     * are the associated resource level version info.
     * </pre>
     *
     * <code>map&lt;string, string&gt; initial_resource_versions = 3;</code>
     */

    public Builder removeInitialResourceVersions(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      internalGetMutableInitialResourceVersions().getMutableMap()
          .remove(key);
      return this;
    }
    /**
     * Use alternate mutation accessors instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String>
    getMutableInitialResourceVersions() {
      return internalGetMutableInitialResourceVersions().getMutableMap();
    }
    /**
     * <pre>
     * When the RequestResources is the first in a stream, the initial_resource_versions must
     * be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
     * resources names of the MCP resources known to the MCP client. The values in the map
     * are the associated resource level version info.
     * </pre>
     *
     * <code>map&lt;string, string&gt; initial_resource_versions = 3;</code>
     */
    public Builder putInitialResourceVersions(
        java.lang.String key,
        java.lang.String value) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      if (value == null) { throw new java.lang.NullPointerException(); }
      internalGetMutableInitialResourceVersions().getMutableMap()
          .put(key, value);
      return this;
    }
    /**
     * <pre>
     * When the RequestResources is the first in a stream, the initial_resource_versions must
     * be populated. Otherwise, initial_resource_versions must be omitted. The keys are the
     * resources names of the MCP resources known to the MCP client. The values in the map
     * are the associated resource level version info.
     * </pre>
     *
     * <code>map&lt;string, string&gt; initial_resource_versions = 3;</code>
     */

    public Builder putAllInitialResourceVersions(
        java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableInitialResourceVersions().getMutableMap()
          .putAll(values);
      return this;
    }

    private java.lang.Object responseNonce_ = "";
    /**
     * <pre>
     * When the RequestResources is an ACK or NACK message in response to a previous RequestResources,
     * the response_nonce must be the nonce in the RequestResources. Otherwise response_nonce must
     * be omitted.
     * </pre>
     *
     * <code>string response_nonce = 4;</code>
     * @return The responseNonce.
     */
    public java.lang.String getResponseNonce() {
      java.lang.Object ref = responseNonce_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        responseNonce_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * When the RequestResources is an ACK or NACK message in response to a previous RequestResources,
     * the response_nonce must be the nonce in the RequestResources. Otherwise response_nonce must
     * be omitted.
     * </pre>
     *
     * <code>string response_nonce = 4;</code>
     * @return The bytes for responseNonce.
     */
    public com.google.protobuf.ByteString
        getResponseNonceBytes() {
      java.lang.Object ref = responseNonce_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        responseNonce_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * When the RequestResources is an ACK or NACK message in response to a previous RequestResources,
     * the response_nonce must be the nonce in the RequestResources. Otherwise response_nonce must
     * be omitted.
     * </pre>
     *
     * <code>string response_nonce = 4;</code>
     * @param value The responseNonce to set.
     * @return This builder for chaining.
     */
    public Builder setResponseNonce(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      responseNonce_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * When the RequestResources is an ACK or NACK message in response to a previous RequestResources,
     * the response_nonce must be the nonce in the RequestResources. Otherwise response_nonce must
     * be omitted.
     * </pre>
     *
     * <code>string response_nonce = 4;</code>
     * @return This builder for chaining.
     */
    public Builder clearResponseNonce() {
      
      responseNonce_ = getDefaultInstance().getResponseNonce();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * When the RequestResources is an ACK or NACK message in response to a previous RequestResources,
     * the response_nonce must be the nonce in the RequestResources. Otherwise response_nonce must
     * be omitted.
     * </pre>
     *
     * <code>string response_nonce = 4;</code>
     * @param value The bytes for responseNonce to set.
     * @return This builder for chaining.
     */
    public Builder setResponseNonceBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      responseNonce_ = value;
      onChanged();
      return this;
    }

    private com.google.rpc.Status errorDetail_;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorDetailBuilder_;
    /**
     * <pre>
     * This is populated when the previously received resources could not be applied
     * The *message* field in *error_details* provides the source internal error
     * related to the failure.
     * </pre>
     *
     * <code>.google.rpc.Status error_detail = 5;</code>
     * @return Whether the errorDetail field is set.
     */
    public boolean hasErrorDetail() {
      return errorDetailBuilder_ != null || errorDetail_ != null;
    }
    /**
     * <pre>
     * This is populated when the previously received resources could not be applied
     * The *message* field in *error_details* provides the source internal error
     * related to the failure.
     * </pre>
     *
     * <code>.google.rpc.Status error_detail = 5;</code>
     * @return The errorDetail.
     */
    public com.google.rpc.Status getErrorDetail() {
      if (errorDetailBuilder_ == null) {
        return errorDetail_ == null ? com.google.rpc.Status.getDefaultInstance() : errorDetail_;
      } else {
        return errorDetailBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * This is populated when the previously received resources could not be applied
     * The *message* field in *error_details* provides the source internal error
     * related to the failure.
     * </pre>
     *
     * <code>.google.rpc.Status error_detail = 5;</code>
     */
    public Builder setErrorDetail(com.google.rpc.Status value) {
      if (errorDetailBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        errorDetail_ = value;
        onChanged();
      } else {
        errorDetailBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * This is populated when the previously received resources could not be applied
     * The *message* field in *error_details* provides the source internal error
     * related to the failure.
     * </pre>
     *
     * <code>.google.rpc.Status error_detail = 5;</code>
     */
    public Builder setErrorDetail(
        com.google.rpc.Status.Builder builderForValue) {
      if (errorDetailBuilder_ == null) {
        errorDetail_ = builderForValue.build();
        onChanged();
      } else {
        errorDetailBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * This is populated when the previously received resources could not be applied
     * The *message* field in *error_details* provides the source internal error
     * related to the failure.
     * </pre>
     *
     * <code>.google.rpc.Status error_detail = 5;</code>
     */
    public Builder mergeErrorDetail(com.google.rpc.Status value) {
      if (errorDetailBuilder_ == null) {
        if (errorDetail_ != null) {
          errorDetail_ =
            com.google.rpc.Status.newBuilder(errorDetail_).mergeFrom(value).buildPartial();
        } else {
          errorDetail_ = value;
        }
        onChanged();
      } else {
        errorDetailBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * This is populated when the previously received resources could not be applied
     * The *message* field in *error_details* provides the source internal error
     * related to the failure.
     * </pre>
     *
     * <code>.google.rpc.Status error_detail = 5;</code>
     */
    public Builder clearErrorDetail() {
      if (errorDetailBuilder_ == null) {
        errorDetail_ = null;
        onChanged();
      } else {
        errorDetail_ = null;
        errorDetailBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * This is populated when the previously received resources could not be applied
     * The *message* field in *error_details* provides the source internal error
     * related to the failure.
     * </pre>
     *
     * <code>.google.rpc.Status error_detail = 5;</code>
     */
    public com.google.rpc.Status.Builder getErrorDetailBuilder() {
      
      onChanged();
      return getErrorDetailFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * This is populated when the previously received resources could not be applied
     * The *message* field in *error_details* provides the source internal error
     * related to the failure.
     * </pre>
     *
     * <code>.google.rpc.Status error_detail = 5;</code>
     */
    public com.google.rpc.StatusOrBuilder getErrorDetailOrBuilder() {
      if (errorDetailBuilder_ != null) {
        return errorDetailBuilder_.getMessageOrBuilder();
      } else {
        return errorDetail_ == null ?
            com.google.rpc.Status.getDefaultInstance() : errorDetail_;
      }
    }
    /**
     * <pre>
     * This is populated when the previously received resources could not be applied
     * The *message* field in *error_details* provides the source internal error
     * related to the failure.
     * </pre>
     *
     * <code>.google.rpc.Status error_detail = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> 
        getErrorDetailFieldBuilder() {
      if (errorDetailBuilder_ == null) {
        errorDetailBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>(
                getErrorDetail(),
                getParentForChildren(),
                isClean());
        errorDetail_ = null;
      }
      return errorDetailBuilder_;
    }

    private boolean incremental_ ;
    /**
     * <pre>
     * Request an incremental update for the specified collection. The source may choose to
     * honor this request or ignore and and provide a full-state update in the corresponding
     * `Resource` response.
     * </pre>
     *
     * <code>bool incremental = 6;</code>
     * @return The incremental.
     */
    public boolean getIncremental() {
      return incremental_;
    }
    /**
     * <pre>
     * Request an incremental update for the specified collection. The source may choose to
     * honor this request or ignore and and provide a full-state update in the corresponding
     * `Resource` response.
     * </pre>
     *
     * <code>bool incremental = 6;</code>
     * @param value The incremental to set.
     * @return This builder for chaining.
     */
    public Builder setIncremental(boolean value) {
      
      incremental_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Request an incremental update for the specified collection. The source may choose to
     * honor this request or ignore and and provide a full-state update in the corresponding
     * `Resource` response.
     * </pre>
     *
     * <code>bool incremental = 6;</code>
     * @return This builder for chaining.
     */
    public Builder clearIncremental() {
      
      incremental_ = false;
      onChanged();
      return this;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

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


    // @@protoc_insertion_point(builder_scope:istio.mcp.v1alpha1.RequestResources)
  }

  // @@protoc_insertion_point(class_scope:istio.mcp.v1alpha1.RequestResources)
  private static final com.alibaba.nacos.istio.model.mcp.RequestResources DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.alibaba.nacos.istio.model.mcp.RequestResources();
  }

  public static com.alibaba.nacos.istio.model.mcp.RequestResources getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public com.alibaba.nacos.istio.model.mcp.RequestResources getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

