getFromServiceType static method
Will get a PcoCollection
of PcoServicesPlan objects (expecting many)
using a path like this: /services/v2/service_types/$serviceTypeId/plans
Available Query Filters:
-
after
filter to plans with a time beginning after theafter
parameter -
before
filter to plans with a time beginning before thebefore
parameter -
future
-
no_dates
-
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<PcoServicesPlan>> getFromServiceType(
String serviceTypeId, {
String? id,
PcoServicesPlanQuery? query,
bool getAll = false,
bool includeAllRelated = false,
bool includeContributors = false,
bool includeMySchedules = false,
bool includePlanTimes = false,
bool includeSeries = false,
}) async {
query ??= PcoServicesPlanQuery();
if (getAll) query.getAll = true;
if (includeAllRelated) query.include.addAll(PcoServicesPlan.canInclude);
if (includeContributors) query.include.add('contributors');
if (includeMySchedules) query.include.add('my_schedules');
if (includePlanTimes) query.include.add('plan_times');
if (includeSeries) query.include.add('series');
var url = '/services/v2/service_types/$serviceTypeId/plans';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoServicesPlan>(url,
query: query, apiVersion: kApiVersion);
}