PcoPeopleConditionQuery constructor

PcoPeopleConditionQuery({
  1. bool includeCreatedBy = false,
  2. String? whereApplication,
  3. String? whereComparison,
  4. String? whereCreatedAt,
  5. String? whereDefinitionClass,
  6. String? whereDefinitionIdentifier,
  7. String? whereDescription,
  8. String? whereSettings,
  9. String? whereUpdatedAt,
  10. PcoPeopleConditionOrder? orderBy,
  11. bool reverse = false,
  12. int perPage = 25,
  13. int pageOffset = 0,
  14. Map<String, String> extraParams = const {},
  15. List<PlanningCenterApiWhere>? where,
  16. Iterable<String> filter = const <String>[],
  17. String? order,
  18. Iterable<String> include = const <String>[],
})

Implementation

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

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

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

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

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

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

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

  /// 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,
  PcoPeopleConditionOrder? 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 (includeCreatedBy) include.add('created_by');

  if (whereApplication != null)
    where.add(PlanningCenterApiWhere.parse('application', whereApplication));
  if (whereComparison != null)
    where.add(PlanningCenterApiWhere.parse('comparison', whereComparison));
  if (whereCreatedAt != null)
    where.add(PlanningCenterApiWhere.parse('created_at', whereCreatedAt));
  if (whereDefinitionClass != null)
    where.add(PlanningCenterApiWhere.parse(
        'definition_class', whereDefinitionClass));
  if (whereDefinitionIdentifier != null)
    where.add(PlanningCenterApiWhere.parse(
        'definition_identifier', whereDefinitionIdentifier));
  if (whereDescription != null)
    where.add(PlanningCenterApiWhere.parse('description', whereDescription));
  if (whereSettings != null)
    where.add(PlanningCenterApiWhere.parse('settings', whereSettings));
  if (whereUpdatedAt != null)
    where.add(PlanningCenterApiWhere.parse('updated_at', whereUpdatedAt));

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