getSubscriptionsFromNoteCategory static method

Future<PcoCollection<PcoPeopleNoteCategorySubscription>> getSubscriptionsFromNoteCategory(
  1. String noteCategoryId, {
  2. PcoPeopleNoteCategorySubscriptionQuery? query,
  3. bool getAll = false,
})

Will get a PcoCollection of PcoPeopleNoteCategorySubscription objects (expecting one) using a path like this: /people/v2/note_categories/$noteCategoryId/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<PcoPeopleNoteCategorySubscription>>
    getSubscriptionsFromNoteCategory(
  String noteCategoryId, {
  PcoPeopleNoteCategorySubscriptionQuery? query,
  bool getAll = false,
}) async {
  query ??= PcoPeopleNoteCategorySubscriptionQuery();
  if (getAll) query.getAll = true;

  var url = '/people/v2/note_categories/$noteCategoryId/subscriptions';

  return PcoCollection.fromApiCall<PcoPeopleNoteCategorySubscription>(url,
      query: query, apiVersion: kApiVersion);
}