getSingleFromCheckInAndLocation static method

Future<PcoCheckInsLocationLabel?> getSingleFromCheckInAndLocation(
  1. String checkInId,
  2. String locationId,
  3. String id, {
  4. PcoCheckInsLocationLabelQuery? query,
  5. bool includeAllRelated = false,
  6. bool includeLabel = false,
  7. bool includeLocation = false,
})

Will get a single PcoCheckInsLocationLabel object using a path like this: /check-ins/v2/check_ins/$checkInId/locations/$locationId/location_labels/[id]

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<PcoCheckInsLocationLabel?> getSingleFromCheckInAndLocation(
  String checkInId,
  String locationId,
  String id, {
  PcoCheckInsLocationLabelQuery? query,
  bool includeAllRelated = false,
  bool includeLabel = false,
  bool includeLocation = false,
}) async {
  query ??= PcoCheckInsLocationLabelQuery();
  if (includeAllRelated)
    query.include.addAll(PcoCheckInsLocationLabel.canInclude);
  if (includeLabel) query.include.add('label');
  if (includeLocation) query.include.add('location');
  var url =
      '/check-ins/v2/check_ins/$checkInId/locations/$locationId/location_labels/$id';
  var retval = await PcoCollection.fromApiCall<PcoCheckInsLocationLabel>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}