getFromBatch static method
Future<PcoCollection<PcoGivingBatchGroup> >
getFromBatch(
- String batchId, {
- String? id,
- PcoGivingBatchGroupQuery? query,
- bool getAll = false,
- bool includeOwner = false,
Will get a PcoCollection
of PcoGivingBatchGroup objects (expecting many)
using a path like this: /giving/v2/batches/$batchId/batch_group
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<PcoGivingBatchGroup>> getFromBatch(
String batchId, {
String? id,
PcoGivingBatchGroupQuery? query,
bool getAll = false,
bool includeOwner = false,
}) async {
query ??= PcoGivingBatchGroupQuery();
if (getAll) 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);
}