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