get static method

Will get a PcoCollection of PcoWebhooksSubscription objects (expecting many) using a path like this: /webhooks/v2/subscriptions

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<PcoWebhooksSubscription>> get({
  String? id,
  PcoWebhooksSubscriptionQuery? query,
  bool getAll = false,
}) async {
  query ??= PcoWebhooksSubscriptionQuery();
  if (getAll) query.getAll = true;

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