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(_SPACE_ID_FIELD_DESC);
  oprot.writeI32(this.space_id);
  oprot.writeFieldEnd();
  if (this.parts != null) {
    oprot.writeFieldBegin(_PARTS_FIELD_DESC);
    {
      oprot
          .writeMapBegin(new TMap(TType.I32, TType.LIST, this.parts?.length));
      for (var elem139 in this.parts?.keys ?? <int>[]) {
        oprot.writeI32(elem139);
        {
          oprot.writeListBegin(
              new TList(TType.STRUCT, this.parts?[elem139]?.length));
          for (var elem140 in this.parts?[elem139] ?? <NewEdge>[]) {
            elem140.write(oprot);
          }
          oprot.writeListEnd();
        }
      }
      oprot.writeMapEnd();
    }
    oprot.writeFieldEnd();
  }
  if (this.prop_names != null) {
    oprot.writeFieldBegin(_PROP_NAMES_FIELD_DESC);
    {
      oprot.writeListBegin(new TList(TType.STRING, this.prop_names?.length));
      for (var elem141 in this.prop_names ?? <Int8List>[]) {
        oprot.writeBinary(elem141);
      }
      oprot.writeListEnd();
    }
    oprot.writeFieldEnd();
  }
  oprot.writeFieldBegin(_IF_NOT_EXISTS_FIELD_DESC);
  oprot.writeBool(this.if_not_exists);
  oprot.writeFieldEnd();
  oprot.writeFieldBegin(_IGNORE_EXISTED_INDEX_FIELD_DESC);
  oprot.writeBool(this.ignore_existed_index);
  oprot.writeFieldEnd();
  if (isSetCommon()) {
    if (this.common != null) {
      oprot.writeFieldBegin(_COMMON_FIELD_DESC);
      this.common?.write(oprot);
      oprot.writeFieldEnd();
    }
  }
  oprot.writeFieldStop();
  oprot.writeStructEnd();
}