getSingleFromPerson static method

Future<PcoPeoplePersonApp?> getSingleFromPerson(
  1. String personId,
  2. String id, {
  3. PcoPeoplePersonAppQuery? query,
  4. bool includeApp = false,
})

Will get a single PcoPeoplePersonApp object using a path like this: /people/v2/people/$personId/person_apps/[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<PcoPeoplePersonApp?> getSingleFromPerson(
  String personId,
  String id, {
  PcoPeoplePersonAppQuery? query,
  bool includeApp = false,
}) async {
  query ??= PcoPeoplePersonAppQuery();

  if (includeApp) query.include.add('app');
  var url = '/people/v2/people/$personId/person_apps/$id';
  var retval = await PcoCollection.fromApiCall<PcoPeoplePersonApp>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}