PcoPeopleCampusQuery constructor

PcoPeopleCampusQuery({
  1. bool includeLists = false,
  2. bool includeServiceTimes = false,
  3. bool includeAllRelated = false,
  4. String? whereCreatedAt,
  5. String? whereUpdatedAt,
  6. PcoPeopleCampusOrder? orderBy,
  7. bool reverse = false,
  8. int perPage = 25,
  9. int pageOffset = 0,
  10. Map<String, String> extraParams = const {},
  11. List<PlanningCenterApiWhere>? where,
  12. Iterable<String> filter = const <String>[],
  13. String? order,
  14. Iterable<String> include = const <String>[],
})

Implementation

PcoPeopleCampusQuery({
  /// include associated lists
  /// when true, adds `?include=lists` to url
  bool includeLists = false,

  /// include associated service_times
  /// when true, adds `?include=service_times` to url
  bool includeServiceTimes = false,

  /// when true, adds `?include=lists,service_times` to url parameters
  bool includeAllRelated = false,

  /// Query by `created_at`
  /// query on a specific created_at, url example: ?where[created_at]=2000-01-01T12:00:00Z
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereCreatedAt,

  /// Query by `updated_at`
  /// query on a specific updated_at, url example: ?where[updated_at]=2000-01-01T12:00:00Z
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereUpdatedAt,
  PcoPeopleCampusOrder? 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 (includeAllRelated || includeLists) include.add('lists');
  if (includeAllRelated || includeServiceTimes) include.add('service_times');

  if (whereCreatedAt != null)
    where.add(PlanningCenterApiWhere.parse('created_at', whereCreatedAt));
  if (whereUpdatedAt != null)
    where.add(PlanningCenterApiWhere.parse('updated_at', whereUpdatedAt));

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