getAllFromSubscriptionAndEvent static method

Future<PcoCollection<PcoWebhooksDelivery>> getAllFromSubscriptionAndEvent(
  1. String subscriptionId,
  2. String eventId, {
  3. String? id,
  4. PcoWebhooksDeliveryQuery? query,
})

Will get a PcoCollection containing ALL PcoWebhooksDelivery objects (expecting many) using a path like this: /webhooks/v2/subscriptions/$subscriptionId/events/$eventId/deliveries

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<PcoWebhooksDelivery>>
    getAllFromSubscriptionAndEvent(
  String subscriptionId,
  String eventId, {
  String? id,
  PcoWebhooksDeliveryQuery? query,
}) async {
  query ??= PcoWebhooksDeliveryQuery();
  query.getAll = true;

  var url =
      '/webhooks/v2/subscriptions/$subscriptionId/events/$eventId/deliveries';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoWebhooksDelivery>(url,
      query: query, apiVersion: kApiVersion);
}