PcoGroupsGroupQuery constructor

PcoGroupsGroupQuery(
  1. {bool includeGroupType = false,
  2. bool includeLocation = false,
  3. bool includeAllRelated = false,
  4. String? whereArchiveStatus,
  5. PcoGroupsGroupFilter? filterBy,
  6. PcoGroupsGroupOrder? orderBy,
  7. bool reverse = false,
  8. int perPage = 25,
  9. int pageOffset = 0,
  10. Map<String, String> extraParams = const {},
  11. List<PlanningCenterApiWhere>? where,
  12. Iterable<String> filter = const <String>[],
  13. String? order,
  14. Iterable<String> include = const <String>[]}
)

Implementation

PcoGroupsGroupQuery({
  /// include associated group_type
  /// when true, adds `?include=group_type` to url
  bool includeGroupType = false,

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

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

  /// Query by `archive_status`
  /// Used for querying only. Defaults to `not_archived`., url example: ?where[archive_status]=value
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereArchiveStatus,
  PcoGroupsGroupFilter? filterBy,
  PcoGroupsGroupOrder? 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 || includeGroupType) include.add('group_type');
  if (includeAllRelated || includeLocation) include.add('location');

  if (whereArchiveStatus != null)
    where.add(
        PlanningCenterApiWhere.parse('archive_status', whereArchiveStatus));

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