getAllFromPerson static method
Will get a PcoCollection
containing ALL PcoPeopleNote objects (expecting many)
using a path like this: /people/v2/people/$personId/notes
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.
This function forces the query.getAll
to be true.
Implementation
static Future<PcoCollection<PcoPeopleNote>> getAllFromPerson(
String personId, {
String? id,
PcoPeopleNoteQuery? query,
bool includeAllRelated = false,
bool includeCategory = false,
bool includeCreatedBy = false,
bool includePerson = false,
}) async {
query ??= PcoPeopleNoteQuery();
query.getAll = true;
if (includeAllRelated) query.include.addAll(PcoPeopleNote.canInclude);
if (includeCategory) query.include.add('category');
if (includeCreatedBy) query.include.add('created_by');
if (includePerson) query.include.add('person');
var url = '/people/v2/people/$personId/notes';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoPeopleNote>(url,
query: query, apiVersion: kApiVersion);
}