getAllFromPerson static method

Future<PcoCollection<PcoServicesTeamLeader>> getAllFromPerson(
  1. String personId, {
  2. String? id,
  3. PcoServicesTeamLeaderQuery? query,
  4. bool includeAllRelated = false,
  5. bool includePeople = false,
  6. bool includeTeam = false,
})

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

Available Query Filters:

  • not_archived
  • not_deleted

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<PcoServicesTeamLeader>> getAllFromPerson(
  String personId, {
  String? id,
  PcoServicesTeamLeaderQuery? query,
  bool includeAllRelated = false,
  bool includePeople = false,
  bool includeTeam = false,
}) async {
  query ??= PcoServicesTeamLeaderQuery();
  query.getAll = true;
  if (includeAllRelated)
    query.include.addAll(PcoServicesTeamLeader.canInclude);
  if (includePeople) query.include.add('people');
  if (includeTeam) query.include.add('team');
  var url = '/services/v2/people/$personId/team_leaders';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoServicesTeamLeader>(url,
      query: query, apiVersion: kApiVersion);
}