getSingleFromTeam static method

Future<PcoServicesTeamLeader?> getSingleFromTeam(
  1. String teamId,
  2. String id, {
  3. PcoServicesTeamLeaderQuery? query,
  4. bool includeAllRelated = false,
  5. bool includePeople = false,
  6. bool includeTeam = false,

Will get a single PcoServicesTeamLeader object using a path like this: /services/v2/teams/$teamId/team_leaders/[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<PcoServicesTeamLeader?> getSingleFromTeam(
  String teamId,
  String id, {
  PcoServicesTeamLeaderQuery? query,
  bool includeAllRelated = false,
  bool includePeople = false,
  bool includeTeam = false,
}) async {
  query ??= PcoServicesTeamLeaderQuery();
  if (includeAllRelated)
  if (includePeople) query.include.add('people');
  if (includeTeam) query.include.add('team');
  var url = '/services/v2/teams/$teamId/team_leaders/$id';
  var retval = await PcoCollection.fromApiCall<PcoServicesTeamLeader>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;