getParentFromCheckInAndLocation static method

Future<PcoCollection<PcoCheckInsLocation>> getParentFromCheckInAndLocation(
  1. String checkInId,
  2. String locationId,
  3. {PcoCheckInsLocationQuery? query,
  4. bool getAll = false,
  5. bool includeAllRelated = false,
  6. bool includeEvent = false,
  7. bool includeLocations = false,
  8. bool includeOptions = false,
  9. bool includeParent = false}
)

Will get a PcoCollection of PcoCheckInsLocation objects (expecting one) using a path like this: /check-ins/v2/check_ins/$checkInId/locations/$locationId/parent

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<PcoCheckInsLocation>>
    getParentFromCheckInAndLocation(
  String checkInId,
  String locationId, {
  PcoCheckInsLocationQuery? query,
  bool getAll = false,
  bool includeAllRelated = false,
  bool includeEvent = false,
  bool includeLocations = false,
  bool includeOptions = false,
  bool includeParent = false,
}) async {
  query ??= PcoCheckInsLocationQuery();
  if (getAll) query.getAll = true;
  if (includeAllRelated) query.include.addAll(PcoCheckInsLocation.canInclude);
  if (includeEvent) query.include.add('event');
  if (includeLocations) query.include.add('locations');
  if (includeOptions) query.include.add('options');
  if (includeParent) query.include.add('parent');
  var url = '/check-ins/v2/check_ins/$checkInId/locations/$locationId/parent';

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