TExternalSearchRequest.java

/**
 * Autogenerated by Thrift Compiler (0.16.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.doris.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)", date = "2026-08-21")
public class TExternalSearchRequest implements org.apache.thrift.TBase<TExternalSearchRequest, TExternalSearchRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TExternalSearchRequest> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExternalSearchRequest");

  private static final org.apache.thrift.protocol.TField SCHEMA_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("schema_version", org.apache.thrift.protocol.TType.I32, (short)1);
  private static final org.apache.thrift.protocol.TField SEARCH_QUERY_FIELD_DESC = new org.apache.thrift.protocol.TField("search_query", org.apache.thrift.protocol.TType.STRUCT, (short)2);
  private static final org.apache.thrift.protocol.TField SEARCH_FILTER_FIELD_DESC = new org.apache.thrift.protocol.TField("search_filter", org.apache.thrift.protocol.TType.STRUCT, (short)3);
  private static final org.apache.thrift.protocol.TField VECTOR_SEARCH_OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("vector_search_options", org.apache.thrift.protocol.TType.STRUCT, (short)4);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TExternalSearchRequestStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TExternalSearchRequestTupleSchemeFactory();

  public int schema_version; // optional
  public @org.apache.thrift.annotation.Nullable TExternalSearchQuery search_query; // optional
  public @org.apache.thrift.annotation.Nullable TSearchFilter search_filter; // optional
  public @org.apache.thrift.annotation.Nullable TVectorSearchOptions vector_search_options; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    SCHEMA_VERSION((short)1, "schema_version"),
    SEARCH_QUERY((short)2, "search_query"),
    SEARCH_FILTER((short)3, "search_filter"),
    VECTOR_SEARCH_OPTIONS((short)4, "vector_search_options");

    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();

    static {
      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // SCHEMA_VERSION
          return SCHEMA_VERSION;
        case 2: // SEARCH_QUERY
          return SEARCH_QUERY;
        case 3: // SEARCH_FILTER
          return SEARCH_FILTER;
        case 4: // VECTOR_SEARCH_OPTIONS
          return VECTOR_SEARCH_OPTIONS;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __SCHEMA_VERSION_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.SCHEMA_VERSION,_Fields.SEARCH_QUERY,_Fields.SEARCH_FILTER,_Fields.VECTOR_SEARCH_OPTIONS};
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.SCHEMA_VERSION, new org.apache.thrift.meta_data.FieldMetaData("schema_version", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.SEARCH_QUERY, new org.apache.thrift.meta_data.FieldMetaData("search_query", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TExternalSearchQuery.class)));
    tmpMap.put(_Fields.SEARCH_FILTER, new org.apache.thrift.meta_data.FieldMetaData("search_filter", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSearchFilter.class)));
    tmpMap.put(_Fields.VECTOR_SEARCH_OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("vector_search_options", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TVectorSearchOptions.class)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExternalSearchRequest.class, metaDataMap);
  }

  public TExternalSearchRequest() {
    this.schema_version = 1;

  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TExternalSearchRequest(TExternalSearchRequest other) {
    __isset_bitfield = other.__isset_bitfield;
    this.schema_version = other.schema_version;
    if (other.isSetSearchQuery()) {
      this.search_query = new TExternalSearchQuery(other.search_query);
    }
    if (other.isSetSearchFilter()) {
      this.search_filter = new TSearchFilter(other.search_filter);
    }
    if (other.isSetVectorSearchOptions()) {
      this.vector_search_options = new TVectorSearchOptions(other.vector_search_options);
    }
  }

  public TExternalSearchRequest deepCopy() {
    return new TExternalSearchRequest(this);
  }

  @Override
  public void clear() {
    this.schema_version = 1;

    this.search_query = null;
    this.search_filter = null;
    this.vector_search_options = null;
  }

  public int getSchemaVersion() {
    return this.schema_version;
  }

  public TExternalSearchRequest setSchemaVersion(int schema_version) {
    this.schema_version = schema_version;
    setSchemaVersionIsSet(true);
    return this;
  }

  public void unsetSchemaVersion() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SCHEMA_VERSION_ISSET_ID);
  }

  /** Returns true if field schema_version is set (has been assigned a value) and false otherwise */
  public boolean isSetSchemaVersion() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SCHEMA_VERSION_ISSET_ID);
  }

  public void setSchemaVersionIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SCHEMA_VERSION_ISSET_ID, value);
  }

  @org.apache.thrift.annotation.Nullable
  public TExternalSearchQuery getSearchQuery() {
    return this.search_query;
  }

  public TExternalSearchRequest setSearchQuery(@org.apache.thrift.annotation.Nullable TExternalSearchQuery search_query) {
    this.search_query = search_query;
    return this;
  }

  public void unsetSearchQuery() {
    this.search_query = null;
  }

  /** Returns true if field search_query is set (has been assigned a value) and false otherwise */
  public boolean isSetSearchQuery() {
    return this.search_query != null;
  }

  public void setSearchQueryIsSet(boolean value) {
    if (!value) {
      this.search_query = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TSearchFilter getSearchFilter() {
    return this.search_filter;
  }

  public TExternalSearchRequest setSearchFilter(@org.apache.thrift.annotation.Nullable TSearchFilter search_filter) {
    this.search_filter = search_filter;
    return this;
  }

  public void unsetSearchFilter() {
    this.search_filter = null;
  }

  /** Returns true if field search_filter is set (has been assigned a value) and false otherwise */
  public boolean isSetSearchFilter() {
    return this.search_filter != null;
  }

  public void setSearchFilterIsSet(boolean value) {
    if (!value) {
      this.search_filter = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TVectorSearchOptions getVectorSearchOptions() {
    return this.vector_search_options;
  }

  public TExternalSearchRequest setVectorSearchOptions(@org.apache.thrift.annotation.Nullable TVectorSearchOptions vector_search_options) {
    this.vector_search_options = vector_search_options;
    return this;
  }

  public void unsetVectorSearchOptions() {
    this.vector_search_options = null;
  }

  /** Returns true if field vector_search_options is set (has been assigned a value) and false otherwise */
  public boolean isSetVectorSearchOptions() {
    return this.vector_search_options != null;
  }

  public void setVectorSearchOptionsIsSet(boolean value) {
    if (!value) {
      this.vector_search_options = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case SCHEMA_VERSION:
      if (value == null) {
        unsetSchemaVersion();
      } else {
        setSchemaVersion((java.lang.Integer)value);
      }
      break;

    case SEARCH_QUERY:
      if (value == null) {
        unsetSearchQuery();
      } else {
        setSearchQuery((TExternalSearchQuery)value);
      }
      break;

    case SEARCH_FILTER:
      if (value == null) {
        unsetSearchFilter();
      } else {
        setSearchFilter((TSearchFilter)value);
      }
      break;

    case VECTOR_SEARCH_OPTIONS:
      if (value == null) {
        unsetVectorSearchOptions();
      } else {
        setVectorSearchOptions((TVectorSearchOptions)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case SCHEMA_VERSION:
      return getSchemaVersion();

    case SEARCH_QUERY:
      return getSearchQuery();

    case SEARCH_FILTER:
      return getSearchFilter();

    case VECTOR_SEARCH_OPTIONS:
      return getVectorSearchOptions();

    }
    throw new java.lang.IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case SCHEMA_VERSION:
      return isSetSchemaVersion();
    case SEARCH_QUERY:
      return isSetSearchQuery();
    case SEARCH_FILTER:
      return isSetSearchFilter();
    case VECTOR_SEARCH_OPTIONS:
      return isSetVectorSearchOptions();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof TExternalSearchRequest)
      return this.equals((TExternalSearchRequest)that);
    return false;
  }

  public boolean equals(TExternalSearchRequest that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_schema_version = true && this.isSetSchemaVersion();
    boolean that_present_schema_version = true && that.isSetSchemaVersion();
    if (this_present_schema_version || that_present_schema_version) {
      if (!(this_present_schema_version && that_present_schema_version))
        return false;
      if (this.schema_version != that.schema_version)
        return false;
    }

    boolean this_present_search_query = true && this.isSetSearchQuery();
    boolean that_present_search_query = true && that.isSetSearchQuery();
    if (this_present_search_query || that_present_search_query) {
      if (!(this_present_search_query && that_present_search_query))
        return false;
      if (!this.search_query.equals(that.search_query))
        return false;
    }

    boolean this_present_search_filter = true && this.isSetSearchFilter();
    boolean that_present_search_filter = true && that.isSetSearchFilter();
    if (this_present_search_filter || that_present_search_filter) {
      if (!(this_present_search_filter && that_present_search_filter))
        return false;
      if (!this.search_filter.equals(that.search_filter))
        return false;
    }

    boolean this_present_vector_search_options = true && this.isSetVectorSearchOptions();
    boolean that_present_vector_search_options = true && that.isSetVectorSearchOptions();
    if (this_present_vector_search_options || that_present_vector_search_options) {
      if (!(this_present_vector_search_options && that_present_vector_search_options))
        return false;
      if (!this.vector_search_options.equals(that.vector_search_options))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetSchemaVersion()) ? 131071 : 524287);
    if (isSetSchemaVersion())
      hashCode = hashCode * 8191 + schema_version;

    hashCode = hashCode * 8191 + ((isSetSearchQuery()) ? 131071 : 524287);
    if (isSetSearchQuery())
      hashCode = hashCode * 8191 + search_query.hashCode();

    hashCode = hashCode * 8191 + ((isSetSearchFilter()) ? 131071 : 524287);
    if (isSetSearchFilter())
      hashCode = hashCode * 8191 + search_filter.hashCode();

    hashCode = hashCode * 8191 + ((isSetVectorSearchOptions()) ? 131071 : 524287);
    if (isSetVectorSearchOptions())
      hashCode = hashCode * 8191 + vector_search_options.hashCode();

    return hashCode;
  }

  @Override
  public int compareTo(TExternalSearchRequest other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetSchemaVersion(), other.isSetSchemaVersion());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSchemaVersion()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema_version, other.schema_version);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSearchQuery(), other.isSetSearchQuery());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSearchQuery()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.search_query, other.search_query);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSearchFilter(), other.isSetSearchFilter());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSearchFilter()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.search_filter, other.search_filter);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetVectorSearchOptions(), other.isSetVectorSearchOptions());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetVectorSearchOptions()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vector_search_options, other.vector_search_options);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("TExternalSearchRequest(");
    boolean first = true;

    if (isSetSchemaVersion()) {
      sb.append("schema_version:");
      sb.append(this.schema_version);
      first = false;
    }
    if (isSetSearchQuery()) {
      if (!first) sb.append(", ");
      sb.append("search_query:");
      if (this.search_query == null) {
        sb.append("null");
      } else {
        sb.append(this.search_query);
      }
      first = false;
    }
    if (isSetSearchFilter()) {
      if (!first) sb.append(", ");
      sb.append("search_filter:");
      if (this.search_filter == null) {
        sb.append("null");
      } else {
        sb.append(this.search_filter);
      }
      first = false;
    }
    if (isSetVectorSearchOptions()) {
      if (!first) sb.append(", ");
      sb.append("vector_search_options:");
      if (this.vector_search_options == null) {
        sb.append("null");
      } else {
        sb.append(this.vector_search_options);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (search_filter != null) {
      search_filter.validate();
    }
    if (vector_search_options != null) {
      vector_search_options.validate();
    }
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class TExternalSearchRequestStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TExternalSearchRequestStandardScheme getScheme() {
      return new TExternalSearchRequestStandardScheme();
    }
  }

  private static class TExternalSearchRequestStandardScheme extends org.apache.thrift.scheme.StandardScheme<TExternalSearchRequest> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TExternalSearchRequest struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // SCHEMA_VERSION
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.schema_version = iprot.readI32();
              struct.setSchemaVersionIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // SEARCH_QUERY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.search_query = new TExternalSearchQuery();
              struct.search_query.read(iprot);
              struct.setSearchQueryIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // SEARCH_FILTER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.search_filter = new TSearchFilter();
              struct.search_filter.read(iprot);
              struct.setSearchFilterIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // VECTOR_SEARCH_OPTIONS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.vector_search_options = new TVectorSearchOptions();
              struct.vector_search_options.read(iprot);
              struct.setVectorSearchOptionsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, TExternalSearchRequest struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetSchemaVersion()) {
        oprot.writeFieldBegin(SCHEMA_VERSION_FIELD_DESC);
        oprot.writeI32(struct.schema_version);
        oprot.writeFieldEnd();
      }
      if (struct.search_query != null) {
        if (struct.isSetSearchQuery()) {
          oprot.writeFieldBegin(SEARCH_QUERY_FIELD_DESC);
          struct.search_query.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.search_filter != null) {
        if (struct.isSetSearchFilter()) {
          oprot.writeFieldBegin(SEARCH_FILTER_FIELD_DESC);
          struct.search_filter.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.vector_search_options != null) {
        if (struct.isSetVectorSearchOptions()) {
          oprot.writeFieldBegin(VECTOR_SEARCH_OPTIONS_FIELD_DESC);
          struct.vector_search_options.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TExternalSearchRequestTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TExternalSearchRequestTupleScheme getScheme() {
      return new TExternalSearchRequestTupleScheme();
    }
  }

  private static class TExternalSearchRequestTupleScheme extends org.apache.thrift.scheme.TupleScheme<TExternalSearchRequest> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TExternalSearchRequest struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetSchemaVersion()) {
        optionals.set(0);
      }
      if (struct.isSetSearchQuery()) {
        optionals.set(1);
      }
      if (struct.isSetSearchFilter()) {
        optionals.set(2);
      }
      if (struct.isSetVectorSearchOptions()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetSchemaVersion()) {
        oprot.writeI32(struct.schema_version);
      }
      if (struct.isSetSearchQuery()) {
        struct.search_query.write(oprot);
      }
      if (struct.isSetSearchFilter()) {
        struct.search_filter.write(oprot);
      }
      if (struct.isSetVectorSearchOptions()) {
        struct.vector_search_options.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TExternalSearchRequest struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        struct.schema_version = iprot.readI32();
        struct.setSchemaVersionIsSet(true);
      }
      if (incoming.get(1)) {
        struct.search_query = new TExternalSearchQuery();
        struct.search_query.read(iprot);
        struct.setSearchQueryIsSet(true);
      }
      if (incoming.get(2)) {
        struct.search_filter = new TSearchFilter();
        struct.search_filter.read(iprot);
        struct.setSearchFilterIsSet(true);
      }
      if (incoming.get(3)) {
        struct.vector_search_options = new TVectorSearchOptions();
        struct.vector_search_options.read(iprot);
        struct.setVectorSearchOptionsIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}