getAllFromPerson static method

Future<PcoCollection<PcoPeopleWorkflowShare>> getAllFromPerson(
  1. String personId, {
  2. String? id,
  3. PcoPeopleWorkflowShareQuery? query,
  4. bool includePerson = false,
})

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

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<PcoPeopleWorkflowShare>> getAllFromPerson(
  String personId, {
  String? id,
  PcoPeopleWorkflowShareQuery? query,
  bool includePerson = false,
}) async {
  query ??= PcoPeopleWorkflowShareQuery();
  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);
}