getAll static method

Future<PcoCollection<PcoPeopleCampus>> getAll({
  1. String? id,
  2. PcoPeopleCampusQuery? query,
  3. bool includeAllRelated = false,
  4. bool includeLists = false,
  5. bool includeServiceTimes = false,
})

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

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<PcoPeopleCampus>> getAll({
  String? id,
  PcoPeopleCampusQuery? query,
  bool includeAllRelated = false,
  bool includeLists = false,
  bool includeServiceTimes = false,
}) async {
  query ??= PcoPeopleCampusQuery();
  query.getAll = true;
  if (includeAllRelated) query.include.addAll(PcoPeopleCampus.canInclude);
  if (includeLists) query.include.add('lists');
  if (includeServiceTimes) query.include.add('service_times');
  var url = '/people/v2/campuses';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoPeopleCampus>(url,
      query: query, apiVersion: kApiVersion);
}