getFromPerson static method

Future<PcoCollection<PcoCheckInsCheckIn>> getFromPerson(
  1. String personId, {
  2. String? id,
  3. PcoCheckInsCheckInQuery? query,
  4. bool getAll = false,
  5. bool includeAllRelated = false,
  6. bool includeCheckInTimes = false,
  7. bool includeCheckedInAt = false,
  8. bool includeCheckedInBy = false,
  9. bool includeCheckedOutBy = false,
  10. bool includeEvent = false,
  11. bool includeEventPeriod = false,
  12. bool includeEventTimes = false,
  13. bool includeLocations = false,
  14. bool includeOptions = false,
  15. bool includePerson = false,
})

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

Available Query Filters:

  • attendee
  • checked_out
  • first_time
  • guest
  • not_checked_out
  • not_one_time_guest
  • one_time_guest
  • regular
  • volunteer

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<PcoCheckInsCheckIn>> getFromPerson(
  String personId, {
  String? id,
  PcoCheckInsCheckInQuery? query,
  bool getAll = false,
  bool includeAllRelated = false,
  bool includeCheckInTimes = false,
  bool includeCheckedInAt = false,
  bool includeCheckedInBy = false,
  bool includeCheckedOutBy = false,
  bool includeEvent = false,
  bool includeEventPeriod = false,
  bool includeEventTimes = false,
  bool includeLocations = false,
  bool includeOptions = false,
  bool includePerson = false,
}) async {
  query ??= PcoCheckInsCheckInQuery();
  if (getAll) query.getAll = true;
  if (includeAllRelated) query.include.addAll(PcoCheckInsCheckIn.canInclude);
  if (includeCheckInTimes) query.include.add('check_in_times');
  if (includeCheckedInAt) query.include.add('checked_in_at');
  if (includeCheckedInBy) query.include.add('checked_in_by');
  if (includeCheckedOutBy) query.include.add('checked_out_by');
  if (includeEvent) query.include.add('event');
  if (includeEventPeriod) query.include.add('event_period');
  if (includeEventTimes) query.include.add('event_times');
  if (includeLocations) query.include.add('locations');
  if (includeOptions) query.include.add('options');
  if (includePerson) query.include.add('person');
  var url = '/check-ins/v2/people/$personId/check_ins';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCheckInsCheckIn>(url,
      query: query, apiVersion: kApiVersion);
}