getFromTeam static method
Will get a PcoCollection
of PcoServicesTeamPosition objects (expecting many)
using a path like this: /services/v2/teams/$teamId/team_positions
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>> getFromTeam(
String teamId, {
String? id,
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/teams/$teamId/team_positions';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoServicesTeamPosition>(url,
query: query, apiVersion: kApiVersion);
}