getFromPerson static method
Will get a PcoCollection
of PcoGivingBatch objects (expecting many)
using a path like this: /giving/v2/people/$personId/batches
Available Query Filters:
committed
in_progress
Getting a PcoCollection
is useful even when retrieving a single object
because it contains error data and helper functions.
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.
Implementation
static Future<PcoCollection<PcoGivingBatch>> getFromPerson(
String personId, {
String? id,
PcoGivingBatchQuery? query,
bool getAll = false,
bool includeAllRelated = false,
bool includeBatchGroup = false,
bool includeOwner = false,
}) async {
query ??= PcoGivingBatchQuery();
if (getAll) 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/people/$personId/batches';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoGivingBatch>(url,
query: query, apiVersion: kApiVersion);
}