PcoPeopleReportQuery constructor

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

Implementation

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

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

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

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

  /// 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 `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,
  PcoPeopleReportOrder? 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 || includeCreatedBy) include.add('created_by');
  if (includeAllRelated || includeUpdatedBy) include.add('updated_by');

  if (whereBody != null)
    where.add(PlanningCenterApiWhere.parse('body', whereBody));
  if (whereCreatedAt != null)
    where.add(PlanningCenterApiWhere.parse('created_at', whereCreatedAt));
  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);
}