getFromServiceType static method

Future<PcoCollection<PcoServicesPlanTime>> getFromServiceType(
  1. String serviceTypeId, {
  2. String? id,
  3. PcoServicesPlanTimeQuery? query,
  4. bool getAll = false,
  5. bool includeSplitTeamRehearsalAssignments = false,
})

Will get a PcoCollection of PcoServicesPlanTime objects (expecting many) using a path like this: /services/v2/service_types/$serviceTypeId/plan_times

Available Query Filters:

  • future
  • named
  • past

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<PcoServicesPlanTime>> getFromServiceType(
  String serviceTypeId, {
  String? id,
  PcoServicesPlanTimeQuery? query,
  bool getAll = false,
  bool includeSplitTeamRehearsalAssignments = false,
}) async {
  query ??= PcoServicesPlanTimeQuery();
  if (getAll) query.getAll = true;

  if (includeSplitTeamRehearsalAssignments)
    query.include.add('split_team_rehearsal_assignments');
  var url = '/services/v2/service_types/$serviceTypeId/plan_times';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoServicesPlanTime>(url,
      query: query, apiVersion: kApiVersion);
}