getSingleFromCheckIn static method

Future<PcoCheckInsOption?> getSingleFromCheckIn(
  1. String checkInId,
  2. String id, {
  3. PcoCheckInsOptionQuery? query,
  4. bool includeLabel = false,
})

Will get a single PcoCheckInsOption object using a path like this: /check-ins/v2/check_ins/$checkInId/options/[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<PcoCheckInsOption?> getSingleFromCheckIn(
  String checkInId,
  String id, {
  PcoCheckInsOptionQuery? query,
  bool includeLabel = false,
}) async {
  query ??= PcoCheckInsOptionQuery();

  if (includeLabel) query.include.add('label');
  var url = '/check-ins/v2/check_ins/$checkInId/options/$id';
  var retval = await PcoCollection.fromApiCall<PcoCheckInsOption>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}