getAllFromServiceTypeAndPlan static method
Will get a PcoCollection
containing ALL PcoServicesLive objects (expecting many)
using a path like this: /services/v2/service_types/$serviceTypeId/plans/$planId/live
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.
This function forces the query.getAll
to be true.
Implementation
static Future<PcoCollection<PcoServicesLive>> getAllFromServiceTypeAndPlan(
String serviceTypeId,
String planId, {
String? id,
PcoServicesLiveQuery? query,
bool includeAllRelated = false,
bool includeController = false,
bool includeCurrentItemTime = false,
bool includeItems = false,
bool includeNextItemTime = false,
bool includeServiceType = false,
}) async {
query ??= PcoServicesLiveQuery();
query.getAll = true;
if (includeAllRelated) query.include.addAll(PcoServicesLive.canInclude);
if (includeController) query.include.add('controller');
if (includeCurrentItemTime) query.include.add('current_item_time');
if (includeItems) query.include.add('items');
if (includeNextItemTime) query.include.add('next_item_time');
if (includeServiceType) query.include.add('service_type');
var url = '/services/v2/service_types/$serviceTypeId/plans/$planId/live';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoServicesLive>(url,
query: query, apiVersion: kApiVersion);
}