getSingleFromPerson static method

Future<PcoServicesBlockout?> getSingleFromPerson(
  1. String personId,
  2. String id, {
  3. PcoServicesBlockoutQuery? query,
})

Will get a single PcoServicesBlockout object using a path like this: /services/v2/people/$personId/blockouts/[id]

Available Query Filters:

  • future
  • past

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<PcoServicesBlockout?> getSingleFromPerson(
  String personId,
  String id, {
  PcoServicesBlockoutQuery? query,
}) async {
  query ??= PcoServicesBlockoutQuery();

  var url = '/services/v2/people/$personId/blockouts/$id';
  var retval = await PcoCollection.fromApiCall<PcoServicesBlockout>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}