getFromList static method

Future<PcoCollection<PcoPeopleListResult>> getFromList(
  1. String listId, {
  2. String? id,
  3. PcoPeopleListResultQuery? query,
  4. bool getAll = false,
})

Will get a PcoCollection of PcoPeopleListResult objects (expecting many) using a path like this: /people/v2/lists/$listId/list_results

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<PcoPeopleListResult>> getFromList(
  String listId, {
  String? id,
  PcoPeopleListResultQuery? query,
  bool getAll = false,
}) async {
  query ??= PcoPeopleListResultQuery();
  if (getAll) query.getAll = true;

  var url = '/people/v2/lists/$listId/list_results';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoPeopleListResult>(url,
      query: query, apiVersion: kApiVersion);
}