listJobs method

Future<List<BulkValidationJob>> listJobs({
  1. int limit = 10,
  2. int page = 1,
})

Lists all bulk validation jobs for the authenticated user.

limit The maximum number of jobs to return (default: 10). page The page number for pagination (default: 1).

Returns a list of BulkValidationJob objects, ordered by creation date (newest first).

Throws an ApiException if:

  • The API key is invalid (401)
  • Network or server errors occur

Example:

final jobs = await client.listJobs(limit: 20, page: 1);
for (final job in jobs) {
  print('${job.id}: ${job.status}');
}

Implementation

Future<List<BulkValidationJob>> listJobs({
  int limit = 10,
  int page = 1,
}) async {
  return _request<List<BulkValidationJob>>(
    'GET',
    '/api/v1/jobs?limit=$limit&page=$page',
    null,
    (json) {
      final jobs = json['jobs'] as List<dynamic>? ?? [];
      return jobs
          .map((e) => BulkValidationJob.fromJson(e as Map<String, dynamic>))
          .toList();
    },
  );
}