getConfig method

Future<GetConfigResp> getConfig(
  1. GetConfigReq? req
)
override

Implementation

Future<GetConfigResp> getConfig(GetConfigReq? req) async {
  oprot.writeMessageBegin(
      new TMessage("getConfig", TMessageType.CALL, nextSeqid()));
  getConfig_args args = new getConfig_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;
  }

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

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