getAll static method

Future<PcoCollection<PcoPeopleHousehold>> getAll(
  1. {String? id,
  2. PcoPeopleHouseholdQuery? query,
  3. bool includePeople = false}
)

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

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

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