getSingleFromAttendanceType static method

Future<PcoCheckInsHeadcount?> getSingleFromAttendanceType(
  1. String attendanceTypeId,
  2. String id, {
  3. PcoCheckInsHeadcountQuery? query,
  4. bool includeAllRelated = false,
  5. bool includeAttendanceType = false,
  6. bool includeEventTime = false,
})

Will get a single PcoCheckInsHeadcount object using a path like this: /check-ins/v2/attendance_types/$attendanceTypeId/headcounts/[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<PcoCheckInsHeadcount?> getSingleFromAttendanceType(
  String attendanceTypeId,
  String id, {
  PcoCheckInsHeadcountQuery? query,
  bool includeAllRelated = false,
  bool includeAttendanceType = false,
  bool includeEventTime = false,
}) async {
  query ??= PcoCheckInsHeadcountQuery();
  if (includeAllRelated)
    query.include.addAll(PcoCheckInsHeadcount.canInclude);
  if (includeAttendanceType) query.include.add('attendance_type');
  if (includeEventTime) query.include.add('event_time');
  var url = '/check-ins/v2/attendance_types/$attendanceTypeId/headcounts/$id';
  var retval = await PcoCollection.fromApiCall<PcoCheckInsHeadcount>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}