getFromPerson static method
Future<PcoCollection<PcoPeoplePersonApp> >
getFromPerson(
- String personId, {
- String? id,
- PcoPeoplePersonAppQuery? query,
- bool getAll = false,
- bool includeApp = false,
Will get a PcoCollection
of PcoPeoplePersonApp objects (expecting many)
using a path like this: /people/v2/people/$personId/person_apps
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<PcoPeoplePersonApp>> getFromPerson(
String personId, {
String? id,
PcoPeoplePersonAppQuery? query,
bool getAll = false,
bool includeApp = false,
}) async {
query ??= PcoPeoplePersonAppQuery();
if (getAll) query.getAll = true;
if (includeApp) query.include.add('app');
var url = '/people/v2/people/$personId/person_apps';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoPeoplePersonApp>(url,
query: query, apiVersion: kApiVersion);
}