get static method

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

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

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<PcoPeopleCampus>> get({
  String? id,
  PcoPeopleCampusQuery? query,
  bool getAll = false,
  bool includeAllRelated = false,
  bool includeLists = false,
  bool includeServiceTimes = false,
}) async {
  query ??= PcoPeopleCampusQuery();
  if (getAll) 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);
}