getSingleFromPersonAndTeamLeader static method
Future<PcoServicesPerson?>
getSingleFromPersonAndTeamLeader(
- String personId,
- String teamLeaderId,
- String id,
- {PcoServicesPersonQuery? query,
- bool includeTeamLeaders = false}
Will get a single PcoServicesPerson
object
using a path like this: /services/v2/people/$personId/team_leaders/$teamLeaderId/people/[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.
Implementation
static Future<PcoServicesPerson?> getSingleFromPersonAndTeamLeader(
String personId,
String teamLeaderId,
String id, {
PcoServicesPersonQuery? query,
bool includeTeamLeaders = false,
}) async {
query ??= PcoServicesPersonQuery();
if (includeTeamLeaders) query.include.add('team_leaders');
var url =
'/services/v2/people/$personId/team_leaders/$teamLeaderId/people/$id';
var retval = await PcoCollection.fromApiCall<PcoServicesPerson>(url,
query: query, apiVersion: kApiVersion);
return retval.items.isEmpty ? null : retval.items.first;
}