PcoServicesPersonQuery constructor

PcoServicesPersonQuery({
  1. bool includeTeamLeaders = false,
  2. String? whereAssignedToRehearsalTeam,
  3. String? whereLegacyId,
  4. PcoServicesPersonOrder? orderBy,
  5. bool reverse = false,
  6. int perPage = 25,
  7. int pageOffset = 0,
  8. Map<String, String> extraParams = const {},
  9. List<PlanningCenterApiWhere>? where,
  10. Iterable<String> filter = const <String>[],
  11. String? order,
  12. Iterable<String> include = const <String>[],
})

Implementation

PcoServicesPersonQuery({
  /// include associated team_leaders
  /// when true, adds `?include=team_leaders` to url
  bool includeTeamLeaders = false,

  /// Query by `assigned_to_rehearsal_team`
  /// query on a specific assigned_to_rehearsal_team, url example: ?where[assigned_to_rehearsal_team]=true
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereAssignedToRehearsalTeam,

  /// Query by `legacy_id`
  /// query on a specific legacy_id, url example: ?where[legacy_id]=primary_key
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereLegacyId,
  PcoServicesPersonOrder? orderBy,

  /// reverse the ordering
  bool reverse = false,

  // direct access to super class params
  super.perPage,
  super.pageOffset,
  super.extraParams,
  super.where,
  super.filter,
  super.order,
  super.include,
}) : super() {
  if (includeTeamLeaders) include.add('team_leaders');

  if (whereAssignedToRehearsalTeam != null)
    where.add(PlanningCenterApiWhere.parse(
        'assigned_to_rehearsal_team', whereAssignedToRehearsalTeam));
  if (whereLegacyId != null)
    where.add(PlanningCenterApiWhere.parse('legacy_id', whereLegacyId));

  if (orderBy != null) order = orderString(orderBy, reverse: reverse);
}