PcoPeopleListShareQuery constructor

PcoPeopleListShareQuery({
  1. bool includePerson = false,
  2. String? whereCreatedAt,
  3. String? whereGroup,
  4. String? whereName,
  5. String? wherePermission,
  6. PcoPeopleListShareOrder? 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

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

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

  /// 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 `permission`
  /// query on a specific permission, url example: ?where[permission]=value
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? wherePermission,
  PcoPeopleListShareOrder? 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 (includePerson) include.add('person');

  if (whereCreatedAt != null)
    where.add(PlanningCenterApiWhere.parse('created_at', whereCreatedAt));
  if (whereGroup != null)
    where.add(PlanningCenterApiWhere.parse('group', whereGroup));
  if (whereName != null)
    where.add(PlanningCenterApiWhere.parse('name', whereName));
  if (wherePermission != null)
    where.add(PlanningCenterApiWhere.parse('permission', wherePermission));

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