getSingleFromPerson static method
Will get a single PcoGivingBatch
object
using a path like this: /giving/v2/people/$personId/batches/[id]
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.
Implementation
static Future<PcoGivingBatch?> getSingleFromPerson(
String personId,
String id, {
PcoGivingBatchQuery? query,
bool includeAllRelated = false,
bool includeBatchGroup = false,
bool includeOwner = false,
}) async {
query ??= PcoGivingBatchQuery();
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/$id';
var retval = await PcoCollection.fromApiCall<PcoGivingBatch>(url,
query: query, apiVersion: kApiVersion);
return retval.items.isEmpty ? null : retval.items.first;
}