getFromServiceTypeAndPlan static method
Will get a PcoCollection
of PcoServicesNeededPosition objects (expecting many)
using a path like this: /services/v2/service_types/$serviceTypeId/plans/$planId/needed_positions
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<PcoServicesNeededPosition>>
getFromServiceTypeAndPlan(
String serviceTypeId,
String planId, {
String? id,
PcoServicesNeededPositionQuery? query,
bool getAll = false,
bool includeAllRelated = false,
bool includeTeam = false,
bool includeTime = false,
}) async {
query ??= PcoServicesNeededPositionQuery();
if (getAll) query.getAll = true;
if (includeAllRelated)
query.include.addAll(PcoServicesNeededPosition.canInclude);
if (includeTeam) query.include.add('team');
if (includeTime) query.include.add('time');
var url =
'/services/v2/service_types/$serviceTypeId/plans/$planId/needed_positions';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoServicesNeededPosition>(url,
query: query, apiVersion: kApiVersion);
}