PcoPeopleRuleQuery constructor

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

Implementation

PcoPeopleRuleQuery({
  /// include associated conditions
  /// when true, adds `?include=conditions` to url
  bool includeConditions = 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 `subset`
  /// query on a specific subset, url example: ?where[subset]=string
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereSubset,

  /// 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,
  PcoPeopleRuleOrder? 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 (includeConditions) include.add('conditions');

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

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