getFromCheckIn static method

Future<PcoCollection<PcoCheckInsEventTime>> getFromCheckIn(
  1. String checkInId, {
  2. String? id,
  3. PcoCheckInsEventTimeQuery? query,
  4. bool getAll = false,
  5. bool includeAllRelated = false,
  6. bool includeEvent = false,
  7. bool includeEventPeriod = false,
  8. bool includeHeadcounts = false,
})

Will get a PcoCollection of PcoCheckInsEventTime objects (expecting many) using a path like this: /check-ins/v2/check_ins/$checkInId/event_times

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<PcoCheckInsEventTime>> getFromCheckIn(
  String checkInId, {
  String? id,
  PcoCheckInsEventTimeQuery? query,
  bool getAll = false,
  bool includeAllRelated = false,
  bool includeEvent = false,
  bool includeEventPeriod = false,
  bool includeHeadcounts = false,
}) async {
  query ??= PcoCheckInsEventTimeQuery();
  if (getAll) query.getAll = true;
  if (includeAllRelated)
    query.include.addAll(PcoCheckInsEventTime.canInclude);
  if (includeEvent) query.include.add('event');
  if (includeEventPeriod) query.include.add('event_period');
  if (includeHeadcounts) query.include.add('headcounts');
  var url = '/check-ins/v2/check_ins/$checkInId/event_times';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCheckInsEventTime>(url,
      query: query, apiVersion: kApiVersion);
}