getFromPerson static method

Future<PcoCollection<PcoPeopleWorkflowShare>> getFromPerson(
  1. String personId, {
  2. String? id,
  3. PcoPeopleWorkflowShareQuery? query,
  4. bool getAll = false,
  5. bool includePerson = false,

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

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.


static Future<PcoCollection<PcoPeopleWorkflowShare>> getFromPerson(
  String personId, {
  String? id,
  PcoPeopleWorkflowShareQuery? query,
  bool getAll = false,
  bool includePerson = false,
}) async {
  query ??= PcoPeopleWorkflowShareQuery();
  if (getAll) query.getAll = true;

  if (includePerson) query.include.add('person');
  var url = '/people/v2/people/$personId/workflow_shares';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoPeopleWorkflowShare>(url,
      query: query, apiVersion: kApiVersion);