getAll static method

Future<PcoCollection<PcoPeopleListCategory>> getAll({
  1. String? id,
  2. PcoPeopleListCategoryQuery? query,
  3. bool includeLists = false,
})

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

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<PcoPeopleListCategory>> getAll({
  String? id,
  PcoPeopleListCategoryQuery? query,
  bool includeLists = false,
}) async {
  query ??= PcoPeopleListCategoryQuery();
  query.getAll = true;

  if (includeLists) query.include.add('lists');
  var url = '/people/v2/list_categories';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoPeopleListCategory>(url,
      query: query, apiVersion: kApiVersion);
}