getAllFromAttendanceType static method

Future<PcoCollection<PcoCheckInsEvent>> getAllFromAttendanceType(
  1. String attendanceTypeId,
  2. {String? id,
  3. PcoCheckInsEventQuery? query,
  4. bool includeAllRelated = false,
  5. bool includeAttendanceTypes = false,
  6. bool includeEventPeriods = false}
)

Will get a PcoCollection containing ALL PcoCheckInsEvent objects (expecting many) using a path like this: /check-ins/v2/attendance_types/$attendanceTypeId/event

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<PcoCheckInsEvent>> getAllFromAttendanceType(
  String attendanceTypeId, {
  String? id,
  PcoCheckInsEventQuery? query,
  bool includeAllRelated = false,
  bool includeAttendanceTypes = false,
  bool includeEventPeriods = false,
}) async {
  query ??= PcoCheckInsEventQuery();
  query.getAll = true;
  if (includeAllRelated) query.include.addAll(PcoCheckInsEvent.canInclude);
  if (includeAttendanceTypes) query.include.add('attendance_types');
  if (includeEventPeriods) query.include.add('event_periods');
  var url = '/check-ins/v2/attendance_types/$attendanceTypeId/event';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCheckInsEvent>(url,
      query: query, apiVersion: kApiVersion);
}