getFromStation static method

Future<PcoCollection<PcoCheckInsCheckInGroup>> getFromStation(
  1. String stationId, {
  2. String? id,
  3. PcoCheckInsCheckInGroupQuery? query,
  4. bool getAll = false,
  5. bool includeAllRelated = false,
  6. bool includeCheckIns = false,
  7. bool includeEventPeriod = false,
  8. bool includePrintStation = false,
})

Will get a PcoCollection of PcoCheckInsCheckInGroup objects (expecting many) using a path like this: /check-ins/v2/stations/$stationId/check_in_groups

Available Query Filters:

  • canceled
  • printed
  • ready
  • skipped

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<PcoCheckInsCheckInGroup>> getFromStation(
  String stationId, {
  String? id,
  PcoCheckInsCheckInGroupQuery? query,
  bool getAll = false,
  bool includeAllRelated = false,
  bool includeCheckIns = false,
  bool includeEventPeriod = false,
  bool includePrintStation = false,
}) async {
  query ??= PcoCheckInsCheckInGroupQuery();
  if (getAll) query.getAll = true;
  if (includeAllRelated)
    query.include.addAll(PcoCheckInsCheckInGroup.canInclude);
  if (includeCheckIns) query.include.add('check_ins');
  if (includeEventPeriod) query.include.add('event_period');
  if (includePrintStation) query.include.add('print_station');
  var url = '/check-ins/v2/stations/$stationId/check_in_groups';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCheckInsCheckInGroup>(url,
      query: query, apiVersion: kApiVersion);
}