getFromCheckInAndLocation static method

Future<PcoCollection<PcoCheckInsLocationEventTime>> getFromCheckInAndLocation(
  1. String checkInId,
  2. String locationId,
  3. {String? id,
  4. PcoCheckInsLocationEventTimeQuery? query,
  5. bool getAll = false,
  6. bool includeAllRelated = false,
  7. bool includeEventTime = false,
  8. bool includeLocation = false}
)

Will get a PcoCollection of PcoCheckInsLocationEventTime objects (expecting many) using a path like this: /check-ins/v2/check_ins/$checkInId/locations/$locationId/location_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<PcoCheckInsLocationEventTime>>
    getFromCheckInAndLocation(
  String checkInId,
  String locationId, {
  String? id,
  PcoCheckInsLocationEventTimeQuery? query,
  bool getAll = false,
  bool includeAllRelated = false,
  bool includeEventTime = false,
  bool includeLocation = false,
}) async {
  query ??= PcoCheckInsLocationEventTimeQuery();
  if (getAll) query.getAll = true;
  if (includeAllRelated)
    query.include.addAll(PcoCheckInsLocationEventTime.canInclude);
  if (includeEventTime) query.include.add('event_time');
  if (includeLocation) query.include.add('location');
  var url =
      '/check-ins/v2/check_ins/$checkInId/locations/$locationId/location_event_times';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCheckInsLocationEventTime>(url,
      query: query, apiVersion: kApiVersion);
}