getAllFromDonationAndRefund static method

Future<PcoCollection<PcoGivingDesignationRefund>> getAllFromDonationAndRefund(
  1. String donationId,
  2. String refundId, {
  3. String? id,
  4. PcoGivingDesignationRefundQuery? query,
  5. bool includeDesignation = false,
})

Will get a PcoCollection containing ALL PcoGivingDesignationRefund objects (expecting many) using a path like this: /giving/v2/donations/$donationId/refund/$refundId/designation_refunds

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<PcoGivingDesignationRefund>>
    getAllFromDonationAndRefund(
  String donationId,
  String refundId, {
  String? id,
  PcoGivingDesignationRefundQuery? query,
  bool includeDesignation = false,
}) async {
  query ??= PcoGivingDesignationRefundQuery();
  query.getAll = true;

  if (includeDesignation) query.include.add('designation');
  var url =
      '/giving/v2/donations/$donationId/refund/$refundId/designation_refunds';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoGivingDesignationRefund>(url,
      query: query, apiVersion: kApiVersion);
}