getAllFromPerson static method

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

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

Available Query Filters:

  • assigned

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<PcoPeopleWorkflowCard>> getAllFromPerson(
  String personId, {
  String? id,
  PcoPeopleWorkflowCardQuery? query,
  bool includeAllRelated = false,
  bool includeAssignee = false,
  bool includeCurrentStep = false,
  bool includePerson = false,
  bool includeWorkflow = false,
}) async {
  query ??= PcoPeopleWorkflowCardQuery();
  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);
}