write method

void write(
  1. TProtocol oprot
)
override

Writes the objects out to the oprot protocol.

Implementation

write(TProtocol oprot) {
  validate();

  oprot.writeStructBegin(_STRUCT_DESC);
  oprot.writeFieldBegin(_INDEX_ID_FIELD_DESC);
  oprot.writeI32(this.index_id);
  oprot.writeFieldEnd();
  if (this.index_name != null) {
    oprot.writeFieldBegin(_INDEX_NAME_FIELD_DESC);
    oprot.writeBinary(this.index_name);
    oprot.writeFieldEnd();
  }
  if (this.schema_id != null) {
    oprot.writeFieldBegin(_SCHEMA_ID_FIELD_DESC);
    this.schema_id?.write(oprot);
    oprot.writeFieldEnd();
  }
  if (this.schema_name != null) {
    oprot.writeFieldBegin(_SCHEMA_NAME_FIELD_DESC);
    oprot.writeBinary(this.schema_name);
    oprot.writeFieldEnd();
  }
  if (this.fields != null) {
    oprot.writeFieldBegin(_FIELDS_FIELD_DESC);
    {
      oprot.writeListBegin(new TList(TType.STRUCT, this.fields?.length));
      for (var elem11 in this.fields ?? []) {
        elem11.write(oprot);
      }
      oprot.writeListEnd();
    }
    oprot.writeFieldEnd();
  }
  if (isSetComment()) {
    if (this.comment != null) {
      oprot.writeFieldBegin(_COMMENT_FIELD_DESC);
      oprot.writeBinary(this.comment);
      oprot.writeFieldEnd();
    }
  }
  if (isSetIndex_params()) {
    if (this.index_params != null) {
      oprot.writeFieldBegin(_INDEX_PARAMS_FIELD_DESC);
      this.index_params?.write(oprot);
      oprot.writeFieldEnd();
    }
  }
  oprot.writeFieldStop();
  oprot.writeStructEnd();
}