listHosts method

Future<ListHostsResp> listHosts(
  1. ListHostsReq? req
)
override

Implementation

Future<ListHostsResp> listHosts(ListHostsReq? req) async {
  oprot.writeMessageBegin(
      new TMessage("listHosts", TMessageType.CALL, nextSeqid()));
  listHosts_args args = new listHosts_args();
  args.req = req;
  args.write(oprot);
  oprot.writeMessageEnd();

  await oprot.trans_.flush();

  TMessage msg = iprot.readMessageBegin();
  if (msg.type == TMessageType.EXCEPTION) {
    TApplicationError error = TApplicationError.read(iprot);
    iprot.readMessageEnd();
    throw error;
  }

  listHosts_result result = new listHosts_result();
  result.read(iprot);
  iprot.readMessageEnd();
  if (result.isSetSuccess()) {
    return result.success!;
  }

  throw new TApplicationError(TApplicationErrorType.MISSING_RESULT,
      "listHosts failed: unknown result");
}