getAll static method

Future<PcoCollection<PcoServicesServiceType>> getAll({
  1. String? id,
  2. PcoServicesServiceTypeQuery? query,
  3. bool includeTimePreferenceOptions = false,
})

Will get a PcoCollection containing ALL PcoServicesServiceType objects (expecting many) using a path like this: /services/v2/service_types

Available Query Filters:

  • no_parent

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<PcoServicesServiceType>> getAll({
  String? id,
  PcoServicesServiceTypeQuery? query,
  bool includeTimePreferenceOptions = false,
}) async {
  query ??= PcoServicesServiceTypeQuery();
  query.getAll = true;

  if (includeTimePreferenceOptions)
    query.include.add('time_preference_options');
  var url = '/services/v2/service_types';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoServicesServiceType>(url,
      query: query, apiVersion: kApiVersion);
}