getFromPerson static method

Future<PcoCollection<PcoCheckInsPass>> getFromPerson(
  1. String personId, {
  2. String? id,
  3. PcoCheckInsPassQuery? query,
  4. bool getAll = false,
  5. bool includePerson = false,
})

Will get a PcoCollection of PcoCheckInsPass objects (expecting many) using a path like this: /check-ins/v2/people/$personId/passes

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<PcoCheckInsPass>> getFromPerson(
  String personId, {
  String? id,
  PcoCheckInsPassQuery? query,
  bool getAll = false,
  bool includePerson = false,
}) async {
  query ??= PcoCheckInsPassQuery();
  if (getAll) query.getAll = true;

  if (includePerson) query.include.add('person');
  var url = '/check-ins/v2/people/$personId/passes';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCheckInsPass>(url,
      query: query, apiVersion: kApiVersion);
}