getFromPerson static method

Future<PcoCollection<PcoServicesBlockout>> getFromPerson(
  1. String personId, {
  2. String? id,
  3. PcoServicesBlockoutQuery? query,
  4. bool getAll = false,
})

Will get a PcoCollection of PcoServicesBlockout objects (expecting many) using a path like this: /services/v2/people/$personId/blockouts

Available Query Filters:

  • future
  • past

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<PcoServicesBlockout>> getFromPerson(
  String personId, {
  String? id,
  PcoServicesBlockoutQuery? query,
  bool getAll = false,
}) async {
  query ??= PcoServicesBlockoutQuery();
  if (getAll) query.getAll = true;

  var url = '/services/v2/people/$personId/blockouts';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoServicesBlockout>(url,
      query: query, apiVersion: kApiVersion);
}