getSingleFromSeries static method
Will get a single PcoServicesPlan
object
using a path like this: /services/v2/series/$seriesId/plans/[id]
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<PcoServicesPlan?> getSingleFromSeries(
String seriesId,
String id, {
PcoServicesPlanQuery? query,
bool includeAllRelated = false,
bool includeContributors = false,
bool includeMySchedules = false,
bool includePlanTimes = false,
bool includeSeries = false,
}) async {
query ??= PcoServicesPlanQuery();
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/series/$seriesId/plans/$id';
var retval = await PcoCollection.fromApiCall<PcoServicesPlan>(url,
query: query, apiVersion: kApiVersion);
return retval.items.isEmpty ? null : retval.items.first;
}