getAll static method

Future<PcoCollection<PcoGivingBatch>> getAll({
  1. String? id,
  2. PcoGivingBatchQuery? query,
  3. bool includeAllRelated = false,
  4. bool includeBatchGroup = false,
  5. bool includeOwner = false,
})

Will get a PcoCollection containing ALL PcoGivingBatch objects (expecting many) using a path like this: /giving/v2/batches

Available Query Filters:

  • committed
  • in_progress

Additional options may be specified by using the query argument, but some query options are also available as boolean flags in this function call too.

This function forces the query.getAll to be true.

Implementation

static Future<PcoCollection<PcoGivingBatch>> getAll({
  String? id,
  PcoGivingBatchQuery? query,
  bool includeAllRelated = false,
  bool includeBatchGroup = false,
  bool includeOwner = false,
}) async {
  query ??= PcoGivingBatchQuery();
  query.getAll = true;
  if (includeAllRelated) query.include.addAll(PcoGivingBatch.canInclude);
  if (includeBatchGroup) query.include.add('batch_group');
  if (includeOwner) query.include.add('owner');
  var url = '/giving/v2/batches';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoGivingBatch>(url,
      query: query, apiVersion: kApiVersion);
}