PcoPeopleNoteQuery constructor

PcoPeopleNoteQuery({
  1. bool includeCategory = false,
  2. bool includeCreatedBy = false,
  3. bool includePerson = false,
  4. bool includeAllRelated = false,
  5. String? whereNote,
  6. String? whereNoteCategoryId,
  7. PcoPeopleNoteOrder? orderBy,
  8. bool reverse = false,
  9. int perPage = 25,
  10. int pageOffset = 0,
  11. Map<String, String> extraParams = const {},
  12. List<PlanningCenterApiWhere>? where,
  13. Iterable<String> filter = const <String>[],
  14. String? order,
  15. Iterable<String> include = const <String>[],
})

Implementation

PcoPeopleNoteQuery({
  /// include associated category
  /// when true, adds `?include=category` to url
  bool includeCategory = false,

  /// include associated created_by
  /// when true, adds `?include=created_by` to url
  bool includeCreatedBy = false,

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

  /// when true, adds `?include=category,created_by,person` to url parameters
  bool includeAllRelated = false,

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

  /// Query by `note_category_id`
  /// query on a specific note_category_id, url example: ?where[note_category_id]=primary_key
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereNoteCategoryId,
  PcoPeopleNoteOrder? 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 || includeCategory) include.add('category');
  if (includeAllRelated || includeCreatedBy) include.add('created_by');
  if (includeAllRelated || includePerson) include.add('person');

  if (whereNote != null)
    where.add(PlanningCenterApiWhere.parse('note', whereNote));
  if (whereNoteCategoryId != null)
    where.add(PlanningCenterApiWhere.parse(
        'note_category_id', whereNoteCategoryId));

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