get static method

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

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

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