listRoles method

Future<ListRolesResp> listRoles(
  1. ListRolesReq? req
)
override

Implementation

Future<ListRolesResp> listRoles(ListRolesReq? req) async {
  oprot.writeMessageBegin(
      new TMessage("listRoles", TMessageType.CALL, nextSeqid()));
  listRoles_args args = new listRoles_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;
  }

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

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