getAllFromFolder static method

Future<PcoCollection<PcoServicesFolder>> getAllFromFolder(
  1. String folderId, {
  2. String? id,
  3. PcoServicesFolderQuery? query,
  4. bool includeServiceTypes = false,
})

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

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<PcoServicesFolder>> getAllFromFolder(
  String folderId, {
  String? id,
  PcoServicesFolderQuery? query,
  bool includeServiceTypes = false,
}) async {
  query ??= PcoServicesFolderQuery();
  query.getAll = true;

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