getAll static method

Future<PcoCollection<PcoPeopleList>> getAll({
  1. String? id,
  2. PcoPeopleListQuery? query,
  3. bool includeAllRelated = false,
  4. bool includeCampus = false,
  5. bool includeCategory = false,
  6. bool includeCreatedBy = false,
  7. bool includeMailchimpSyncStatus = false,
  8. bool includePeople = false,
  9. bool includeRules = false,
  10. bool includeShares = false,
  11. bool includeUpdatedBy = false,
})

Will get a PcoCollection containing ALL PcoPeopleList objects (expecting many) using a path like this: /people/v2/lists

Available Query Filters:

  • can_manage
  • recently_viewed
  • starred

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<PcoPeopleList>> getAll({
  String? id,
  PcoPeopleListQuery? query,
  bool includeAllRelated = false,
  bool includeCampus = false,
  bool includeCategory = false,
  bool includeCreatedBy = false,
  bool includeMailchimpSyncStatus = false,
  bool includePeople = false,
  bool includeRules = false,
  bool includeShares = false,
  bool includeUpdatedBy = false,
}) async {
  query ??= PcoPeopleListQuery();
  query.getAll = true;
  if (includeAllRelated) query.include.addAll(PcoPeopleList.canInclude);
  if (includeCampus) query.include.add('campus');
  if (includeCategory) query.include.add('category');
  if (includeCreatedBy) query.include.add('created_by');
  if (includeMailchimpSyncStatus) query.include.add('mailchimp_sync_status');
  if (includePeople) query.include.add('people');
  if (includeRules) query.include.add('rules');
  if (includeShares) query.include.add('shares');
  if (includeUpdatedBy) query.include.add('updated_by');
  var url = '/people/v2/lists';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoPeopleList>(url,
      query: query, apiVersion: kApiVersion);
}