addHosts method

Future<ExecResp> addHosts(
  1. AddHostsReq? req
)
override

Implementation

Future<ExecResp> addHosts(AddHostsReq? req) async {
  oprot.writeMessageBegin(
      new TMessage("addHosts", TMessageType.CALL, nextSeqid()));
  addHosts_args args = new addHosts_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;
  }

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

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