getFromServiceTypeAndTeamPositionAndPersonTeamPositionAssignment static method
Future<PcoCollection<PcoServicesTeamPosition> >
getFromServiceTypeAndTeamPositionAndPersonTeamPositionAssignment(})
Will get a PcoCollection of PcoServicesTeamPosition objects (expecting one)
using a path like this: /services/v2/service_types/$serviceTypeId/team_positions/$teamPositionId/person_team_position_assignments/$personTeamPositionAssignmentId/team_position
Getting a PcoCollection is useful even when retrieving a single object because it contains error data and helper functions.
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<PcoCollection<PcoServicesTeamPosition>>
getFromServiceTypeAndTeamPositionAndPersonTeamPositionAssignment(
String serviceTypeId,
String teamPositionId,
String personTeamPositionAssignmentId, {
PcoServicesTeamPositionQuery? query,
bool getAll = false,
bool includeAllRelated = false,
bool includeTags = false,
bool includeTeam = false,
}) async {
query ??= PcoServicesTeamPositionQuery();
if (getAll) query.getAll = true;
if (includeAllRelated)
query.include.addAll(PcoServicesTeamPosition.canInclude);
if (includeTags) query.include.add('tags');
if (includeTeam) query.include.add('team');
var url =
'/services/v2/service_types/$serviceTypeId/team_positions/$teamPositionId/person_team_position_assignments/$personTeamPositionAssignmentId/team_position';
return PcoCollection.fromApiCall<PcoServicesTeamPosition>(url,
query: query, apiVersion: kApiVersion);
}