getSingleFromPerson static method

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

Will get a single PcoPeopleWorkflowShare object using a path like this: /people/v2/people/$personId/workflow_shares/[id]

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

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