PcoGroupsEventQuery constructor

PcoGroupsEventQuery({
  1. bool includeGroup = false,
  2. bool includeLocation = false,
  3. bool includeAllRelated = false,
  4. String? whereEndsAt,
  5. String? whereName,
  6. String? whereStartsAt,
  7. PcoGroupsEventFilter? filterBy,
  8. PcoGroupsEventOrder? 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

PcoGroupsEventQuery({
  /// include associated group
  /// when true, adds `?include=group` to url
  bool includeGroup = false,

  /// include associated location
  /// when true, adds `?include=location` to url
  bool includeLocation = false,

  /// when true, adds `?include=group,location` to url parameters
  bool includeAllRelated = false,

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

  /// 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 `starts_at`
  /// query on a specific starts_at, url example: ?where[starts_at]=2000-01-01T12:00:00Z
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereStartsAt,
  PcoGroupsEventFilter? filterBy,
  PcoGroupsEventOrder? 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 || includeGroup) include.add('group');
  if (includeAllRelated || includeLocation) include.add('location');

  if (whereEndsAt != null)
    where.add(PlanningCenterApiWhere.parse('ends_at', whereEndsAt));
  if (whereName != null)
    where.add(PlanningCenterApiWhere.parse('name', whereName));
  if (whereStartsAt != null)
    where.add(PlanningCenterApiWhere.parse('starts_at', whereStartsAt));

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