getAll static method

Future<PcoCollection<PcoGivingBatchGroup>> getAll({
  1. String? id,
  2. PcoGivingBatchGroupQuery? query,
  3. bool includeOwner = false,
})

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

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<PcoGivingBatchGroup>> getAll({
  String? id,
  PcoGivingBatchGroupQuery? query,
  bool includeOwner = false,
}) async {
  query ??= PcoGivingBatchGroupQuery();
  query.getAll = true;

  if (includeOwner) query.include.add('owner');
  var url = '/giving/v2/batch_groups';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoGivingBatchGroup>(url,
      query: query, apiVersion: kApiVersion);
}