getCategoryFromNote static method
Will get a PcoCollection
of PcoPeopleNoteCategory objects (expecting one)
using a path like this: /people/v2/notes/$noteId/category
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<PcoPeopleNoteCategory>> getCategoryFromNote(
String noteId, {
PcoPeopleNoteCategoryQuery? query,
bool getAll = false,
bool includeAllRelated = false,
bool includeShares = false,
bool includeSubscribers = false,
bool includeSubscriptions = false,
}) async {
query ??= PcoPeopleNoteCategoryQuery();
if (getAll) query.getAll = true;
if (includeAllRelated)
query.include.addAll(PcoPeopleNoteCategory.canInclude);
if (includeShares) query.include.add('shares');
if (includeSubscribers) query.include.add('subscribers');
if (includeSubscriptions) query.include.add('subscriptions');
var url = '/people/v2/notes/$noteId/category';
return PcoCollection.fromApiCall<PcoPeopleNoteCategory>(url,
query: query, apiVersion: kApiVersion);
}