getAll static method

Future<PcoCollection<PcoGivingDonation>> getAll({
  1. String? id,
  2. PcoGivingDonationQuery? query,
  3. bool includeAllRelated = false,
  4. bool includeDesignations = false,
  5. bool includeLabels = false,
  6. bool includeNote = false,
  7. bool includeRefund = false,
})

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

Available Query Filters:

  • succeeded

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<PcoGivingDonation>> getAll({
  String? id,
  PcoGivingDonationQuery? query,
  bool includeAllRelated = false,
  bool includeDesignations = false,
  bool includeLabels = false,
  bool includeNote = false,
  bool includeRefund = false,
}) async {
  query ??= PcoGivingDonationQuery();
  query.getAll = true;
  if (includeAllRelated) query.include.addAll(PcoGivingDonation.canInclude);
  if (includeDesignations) query.include.add('designations');
  if (includeLabels) query.include.add('labels');
  if (includeNote) query.include.add('note');
  if (includeRefund) query.include.add('refund');
  var url = '/giving/v2/donations';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoGivingDonation>(url,
      query: query, apiVersion: kApiVersion);
}