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(_CODE_FIELD_DESC);
  oprot.writeI32(this.code);
  oprot.writeFieldEnd();
  if (this.leader != null) {
    oprot.writeFieldBegin(_LEADER_FIELD_DESC);
    this.leader?.write(oprot);
    oprot.writeFieldEnd();
  }
  if (this.host_services != null) {
    oprot.writeFieldBegin(_HOST_SERVICES_FIELD_DESC);
    {
      oprot.writeMapBegin(
          new TMap(TType.STRING, TType.LIST, this.host_services?.length));
      for (var elem400 in this.host_services?.keys ?? <String>[]) {
        oprot.writeString(elem400);
        {
          oprot.writeListBegin(
              new TList(TType.STRUCT, this.host_services?[elem400]?.length));
          for (var elem401
              in this.host_services?[elem400] ?? <ServiceInfo>[]) {
            elem401.write(oprot);
          }
          oprot.writeListEnd();
        }
      }
      oprot.writeMapEnd();
    }
    oprot.writeFieldEnd();
  }
  oprot.writeFieldStop();
  oprot.writeStructEnd();
}