PcoPeopleListQuery constructor

PcoPeopleListQuery({
  1. bool includeCampus = false,
  2. bool includeCategory = false,
  3. bool includeCreatedBy = false,
  4. bool includeMailchimpSyncStatus = false,
  5. bool includePeople = false,
  6. bool includeRules = false,
  7. bool includeShares = false,
  8. bool includeUpdatedBy = false,
  9. bool includeAllRelated = false,
  10. String? whereBatchCompletedAt,
  11. String? whereCreatedAt,
  12. String? whereId,
  13. String? whereName,
  14. String? whereUpdatedAt,
  15. PcoPeopleListFilter? filterBy,
  16. PcoPeopleListOrder? orderBy,
  17. bool reverse = false,
  18. int perPage = 25,
  19. int pageOffset = 0,
  20. Map<String, String> extraParams = const {},
  21. List<PlanningCenterApiWhere>? where,
  22. Iterable<String> filter = const <String>[],
  23. String? order,
  24. Iterable<String> include = const <String>[],
})

Implementation

PcoPeopleListQuery({
  /// include associated campus
  /// when true, adds `?include=campus` to url
  bool includeCampus = false,

  /// 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 mailchimp_sync_status
  /// when true, adds `?include=mailchimp_sync_status` to url
  bool includeMailchimpSyncStatus = false,

  /// include associated people
  /// when true, adds `?include=people` to url
  bool includePeople = false,

  /// include associated rules
  /// when true, adds `?include=rules` to url
  bool includeRules = false,

  /// include associated shares
  /// when true, adds `?include=shares` to url
  bool includeShares = false,

  /// include associated updated_by
  /// when true, adds `?include=updated_by` to url
  bool includeUpdatedBy = false,

  /// when true, adds `?include=campus,category,created_by,mailchimp_sync_status,people,rules,shares,updated_by` to url parameters
  bool includeAllRelated = false,

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

  /// 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 `id`
  /// query on a specific id, url example: ?where[id]=primary_key
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereId,

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

  /// 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,
  PcoPeopleListFilter? filterBy,
  PcoPeopleListOrder? 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 (includeAllRelated || includeCampus) include.add('campus');
  if (includeAllRelated || includeCategory) include.add('category');
  if (includeAllRelated || includeCreatedBy) include.add('created_by');
  if (includeAllRelated || includeMailchimpSyncStatus)
    include.add('mailchimp_sync_status');
  if (includeAllRelated || includePeople) include.add('people');
  if (includeAllRelated || includeRules) include.add('rules');
  if (includeAllRelated || includeShares) include.add('shares');
  if (includeAllRelated || includeUpdatedBy) include.add('updated_by');

  if (whereBatchCompletedAt != null)
    where.add(PlanningCenterApiWhere.parse(
        'batch_completed_at', whereBatchCompletedAt));
  if (whereCreatedAt != null)
    where.add(PlanningCenterApiWhere.parse('created_at', whereCreatedAt));
  if (whereId != null) where.add(PlanningCenterApiWhere.parse('id', whereId));
  if (whereName != null)
    where.add(PlanningCenterApiWhere.parse('name', whereName));
  if (whereUpdatedAt != null)
    where.add(PlanningCenterApiWhere.parse('updated_at', whereUpdatedAt));

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