getFromPerson static method

Future<PcoCollection<PcoPeopleWorkflowCard>> getFromPerson(
  1. String personId, {
  2. String? id,
  3. PcoPeopleWorkflowCardQuery? query,
  4. bool getAll = false,
  5. bool includeAllRelated = false,
  6. bool includeAssignee = false,
  7. bool includeCurrentStep = false,
  8. bool includePerson = false,
  9. bool includeWorkflow = false,
})

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

Available Query Filters:

  • assigned

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<PcoPeopleWorkflowCard>> getFromPerson(
  String personId, {
  String? id,
  PcoPeopleWorkflowCardQuery? query,
  bool getAll = false,
  bool includeAllRelated = false,
  bool includeAssignee = false,
  bool includeCurrentStep = false,
  bool includePerson = false,
  bool includeWorkflow = false,
}) async {
  query ??= PcoPeopleWorkflowCardQuery();
  if (getAll) query.getAll = true;
  if (includeAllRelated)
    query.include.addAll(PcoPeopleWorkflowCard.canInclude);
  if (includeAssignee) query.include.add('assignee');
  if (includeCurrentStep) query.include.add('current_step');
  if (includePerson) query.include.add('person');
  if (includeWorkflow) query.include.add('workflow');
  var url = '/people/v2/people/$personId/workflow_cards';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoPeopleWorkflowCard>(url,
      query: query, apiVersion: kApiVersion);
}