getFromEvent static method

Future<PcoCollection<PcoCheckInsAttendanceType>> getFromEvent(
  1. String eventId, {
  2. String? id,
  3. PcoCheckInsAttendanceTypeQuery? query,
  4. bool getAll = false,
  5. bool includeEvent = false,
})

Will get a PcoCollection of PcoCheckInsAttendanceType objects (expecting many) using a path like this: /check-ins/v2/events/$eventId/attendance_types

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<PcoCheckInsAttendanceType>> getFromEvent(
  String eventId, {
  String? id,
  PcoCheckInsAttendanceTypeQuery? query,
  bool getAll = false,
  bool includeEvent = false,
}) async {
  query ??= PcoCheckInsAttendanceTypeQuery();
  if (getAll) query.getAll = true;

  if (includeEvent) query.include.add('event');
  var url = '/check-ins/v2/events/$eventId/attendance_types';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCheckInsAttendanceType>(url,
      query: query, apiVersion: kApiVersion);
}