getAllFromPersonAndTeamLeader static method

Future<PcoCollection<PcoServicesPerson>> getAllFromPersonAndTeamLeader(
  1. String personId,
  2. String teamLeaderId, {
  3. String? id,
  4. PcoServicesPersonQuery? query,
  5. bool includeTeamLeaders = false,
})

Will get a PcoCollection containing ALL PcoServicesPerson objects (expecting many) using a path like this: /services/v2/people/$personId/team_leaders/$teamLeaderId/people

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<PcoServicesPerson>> getAllFromPersonAndTeamLeader(
  String personId,
  String teamLeaderId, {
  String? id,
  PcoServicesPersonQuery? query,
  bool includeTeamLeaders = false,
}) async {
  query ??= PcoServicesPersonQuery();
  query.getAll = true;

  if (includeTeamLeaders) query.include.add('team_leaders');
  var url = '/services/v2/people/$personId/team_leaders/$teamLeaderId/people';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoServicesPerson>(url,
      query: query, apiVersion: kApiVersion);
}