getFromCheckIn static method

Future<PcoCollection<PcoCheckInsEventPeriod>> getFromCheckIn(
  1. String checkInId,
  2. {PcoCheckInsEventPeriodQuery? query,
  3. bool getAll = false,
  4. bool includeAllRelated = false,
  5. bool includeEvent = false,
  6. bool includeEventTimes = false}
)

Will get a PcoCollection of PcoCheckInsEventPeriod objects (expecting one) using a path like this: /check-ins/v2/check_ins/$checkInId/event_period

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<PcoCheckInsEventPeriod>> getFromCheckIn(
  String checkInId, {
  PcoCheckInsEventPeriodQuery? query,
  bool getAll = false,
  bool includeAllRelated = false,
  bool includeEvent = false,
  bool includeEventTimes = false,
}) async {
  query ??= PcoCheckInsEventPeriodQuery();
  if (getAll) query.getAll = true;
  if (includeAllRelated)
    query.include.addAll(PcoCheckInsEventPeriod.canInclude);
  if (includeEvent) query.include.add('event');
  if (includeEventTimes) query.include.add('event_times');
  var url = '/check-ins/v2/check_ins/$checkInId/event_period';

  return PcoCollection.fromApiCall<PcoCheckInsEventPeriod>(url,
      query: query, apiVersion: kApiVersion);
}