getAllFromPerson static method
Future<PcoCollection<PcoServicesSchedule> >
getAllFromPerson(
- String personId, {
- String? id,
- PcoServicesScheduleQuery? query,
- bool includePlanTimes = false,
Will get a PcoCollection
containing ALL PcoServicesSchedule objects (expecting many)
using a path like this: /services/v2/people/$personId/schedules
Available Query Filters:
-
after
Fetch schedules after the includedafter
iso8601 date param. e.g.?filter=after&after=2020-01-01T00:00:00Z
-
all
-
before
Fetch schedules before the includedbefore
iso8601 date param. e.g.?filter=before&before=2020-01-01T00:00:00Z
-
future
-
not_across_organizations
-
past
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<PcoServicesSchedule>> getAllFromPerson(
String personId, {
String? id,
PcoServicesScheduleQuery? query,
bool includePlanTimes = false,
}) async {
query ??= PcoServicesScheduleQuery();
query.getAll = true;
if (includePlanTimes) query.include.add('plan_times');
var url = '/services/v2/people/$personId/schedules';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoServicesSchedule>(url,
query: query, apiVersion: kApiVersion);
}