getFromPersonAndBlockout static method

Future<PcoCollection<PcoServicesBlockoutException>> getFromPersonAndBlockout(
  1. String personId,
  2. String blockoutId, {
  3. String? id,
  4. PcoServicesBlockoutExceptionQuery? query,
  5. bool getAll = false,
})

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

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<PcoServicesBlockoutException>>
    getFromPersonAndBlockout(
  String personId,
  String blockoutId, {
  String? id,
  PcoServicesBlockoutExceptionQuery? query,
  bool getAll = false,
}) async {
  query ??= PcoServicesBlockoutExceptionQuery();
  if (getAll) query.getAll = true;

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