PcoGroupsAttendanceQuery constructor

PcoGroupsAttendanceQuery({
  1. bool includePerson = false,
  2. String? whereRole,
  3. PcoGroupsAttendanceFilter? filterBy,
  4. PcoGroupsAttendanceOrder? 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

PcoGroupsAttendanceQuery({
  /// include associated person
  /// when true, adds `?include=person` to url
  bool includePerson = false,

  /// Query by `role`
  /// query on a specific role, url example: ?where[role]=value
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereRole,
  PcoGroupsAttendanceFilter? filterBy,
  PcoGroupsAttendanceOrder? 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 (filterBy != null) filter.add(filterString(filterBy));
  if (includePerson) include.add('person');

  if (whereRole != null)
    where.add(PlanningCenterApiWhere.parse('role', whereRole));

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