getAllFromRecurringDonation static method

Future<PcoCollection<PcoGivingPaymentMethod>> getAllFromRecurringDonation(
  1. String recurringDonationId, {
  2. String? id,
  3. PcoGivingPaymentMethodQuery? query,
})

Will get a PcoCollection containing ALL PcoGivingPaymentMethod objects (expecting many) using a path like this: /giving/v2/recurring_donations/$recurringDonationId/payment_method

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<PcoGivingPaymentMethod>>
    getAllFromRecurringDonation(
  String recurringDonationId, {
  String? id,
  PcoGivingPaymentMethodQuery? query,
}) async {
  query ??= PcoGivingPaymentMethodQuery();
  query.getAll = true;

  var url =
      '/giving/v2/recurring_donations/$recurringDonationId/payment_method';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoGivingPaymentMethod>(url,
      query: query, apiVersion: kApiVersion);
}