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);
  if (this.name != null) {
    oprot.writeFieldBegin(_NAME_FIELD_DESC);
    oprot.writeBinary(this.name);
    oprot.writeFieldEnd();
  }
  oprot.writeFieldBegin(_ID_FIELD_DESC);
  oprot.writeI64(this.id);
  oprot.writeFieldEnd();
  if (this.output_var != null) {
    oprot.writeFieldBegin(_OUTPUT_VAR_FIELD_DESC);
    oprot.writeBinary(this.output_var);
    oprot.writeFieldEnd();
  }
  if (isSetDescription()) {
    if (this.description != null) {
      oprot.writeFieldBegin(_DESCRIPTION_FIELD_DESC);
      {
        oprot.writeListBegin(
            new TList(TType.STRUCT, this.description?.length));
        for (var elem15 in this.description ?? []) {
          elem15.write(oprot);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
  }
  if (isSetProfiles()) {
    if (this.profiles != null) {
      oprot.writeFieldBegin(_PROFILES_FIELD_DESC);
      {
        oprot.writeListBegin(new TList(TType.STRUCT, this.profiles?.length));
        for (var elem16 in this.profiles ?? []) {
          elem16.write(oprot);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
  }
  if (isSetBranch_info()) {
    if (this.branch_info != null) {
      oprot.writeFieldBegin(_BRANCH_INFO_FIELD_DESC);
      this.branch_info?.write(oprot);
      oprot.writeFieldEnd();
    }
  }
  if (isSetDependencies()) {
    if (this.dependencies != null) {
      oprot.writeFieldBegin(_DEPENDENCIES_FIELD_DESC);
      {
        oprot.writeListBegin(new TList(TType.I64, this.dependencies?.length));
        for (var elem17 in this.dependencies ?? []) {
          oprot.writeI64(elem17);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
  }
  oprot.writeFieldStop();
  oprot.writeStructEnd();
}