getSingleFromCheckInAndLocation static method

Future<PcoCheckInsEvent?> getSingleFromCheckInAndLocation(
  1. String checkInId,
  2. String locationId,
  3. String id, {
  4. PcoCheckInsEventQuery? query,
  5. bool includeAllRelated = false,
  6. bool includeAttendanceTypes = false,
  7. bool includeEventPeriods = false,
})

Will get a single PcoCheckInsEvent object using a path like this: /check-ins/v2/check_ins/$checkInId/locations/$locationId/event/[id]

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<PcoCheckInsEvent?> getSingleFromCheckInAndLocation(
  String checkInId,
  String locationId,
  String id, {
  PcoCheckInsEventQuery? query,
  bool includeAllRelated = false,
  bool includeAttendanceTypes = false,
  bool includeEventPeriods = false,
}) async {
  query ??= PcoCheckInsEventQuery();
  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/check_ins/$checkInId/locations/$locationId/event/$id';
  var retval = await PcoCollection.fromApiCall<PcoCheckInsEvent>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}