getAllFromFolder static method

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

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

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>> getAllFromFolder(
  String folderId, {
  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/folders/$folderId/service_types';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoServicesServiceType>(url,
      query: query, apiVersion: kApiVersion);
}