getAllFromBatch static method

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

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

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

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