getSingleFromPerson static method

Future<PcoServicesSchedule?> getSingleFromPerson(
  1. String personId,
  2. String id, {
  3. PcoServicesScheduleQuery? query,
  4. bool includePlanTimes = false,
})

Will get a single PcoServicesSchedule object using a path like this: /services/v2/people/$personId/schedules/[id]

Available Query Filters:

  • after Fetch schedules after the included after iso8601 date param. e.g. ?filter=after&after=2020-01-01T00:00:00Z

  • all

  • before Fetch schedules before the included before 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.

Implementation

static Future<PcoServicesSchedule?> getSingleFromPerson(
  String personId,
  String id, {
  PcoServicesScheduleQuery? query,
  bool includePlanTimes = false,
}) async {
  query ??= PcoServicesScheduleQuery();

  if (includePlanTimes) query.include.add('plan_times');
  var url = '/services/v2/people/$personId/schedules/$id';
  var retval = await PcoCollection.fromApiCall<PcoServicesSchedule>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}