getSingle static method

Future<PcoCheckInsPerson?> getSingle(
  1. String id, {
  2. PcoCheckInsPersonQuery? query,
  3. bool includeOrganization = false,
})

Will get a single PcoCheckInsPerson object using a path like this: /check-ins/v2/people/[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<PcoCheckInsPerson?> getSingle(
  String id, {
  PcoCheckInsPersonQuery? query,
  bool includeOrganization = false,
}) async {
  query ??= PcoCheckInsPersonQuery();

  if (includeOrganization) query.include.add('organization');
  var url = '/check-ins/v2/people/$id';
  var retval = await PcoCollection.fromApiCall<PcoCheckInsPerson>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}