PcoPeopleWorkflowQuery constructor

PcoPeopleWorkflowQuery(
  1. {bool includeCategory = false,
  2. bool includeShares = false,
  3. bool includeSteps = false,
  4. bool includeAllRelated = false,
  5. String? whereCampusId,
  6. String? whereCreatedAt,
  7. String? whereDeletedAt,
  8. String? whereId,
  9. String? whereName,
  10. String? whereUpdatedAt,
  11. String? whereWorkflowCategoryId,
  12. PcoPeopleWorkflowFilter? filterBy,
  13. PcoPeopleWorkflowOrder? orderBy,
  14. bool reverse = false,
  15. int perPage = 25,
  16. int pageOffset = 0,
  17. Map<String, String> extraParams = const {},
  18. List<PlanningCenterApiWhere>? where,
  19. Iterable<String> filter = const <String>[],
  20. String? order,
  21. Iterable<String> include = const <String>[]}
)

Implementation

PcoPeopleWorkflowQuery({
  /// include associated category
  /// when true, adds `?include=category` to url
  bool includeCategory = false,

  /// include associated shares
  /// when true, adds `?include=shares` to url
  bool includeShares = false,

  /// include associated steps
  /// when true, adds `?include=steps` to url
  bool includeSteps = false,

  /// when true, adds `?include=category,shares,steps` to url parameters
  bool includeAllRelated = false,

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

  /// 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 `deleted_at`
  /// query on a specific deleted_at, url example: ?where[deleted_at]=2000-01-01T12:00:00Z
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereDeletedAt,

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

  /// 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,

  /// Query by `workflow_category_id`
  /// query on a specific workflow_category_id, url example: ?where[workflow_category_id]=primary_key
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereWorkflowCategoryId,
  PcoPeopleWorkflowFilter? filterBy,
  PcoPeopleWorkflowOrder? 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 || includeCategory) include.add('category');
  if (includeAllRelated || includeShares) include.add('shares');
  if (includeAllRelated || includeSteps) include.add('steps');

  if (whereCampusId != null)
    where.add(PlanningCenterApiWhere.parse('campus_id', whereCampusId));
  if (whereCreatedAt != null)
    where.add(PlanningCenterApiWhere.parse('created_at', whereCreatedAt));
  if (whereDeletedAt != null)
    where.add(PlanningCenterApiWhere.parse('deleted_at', whereDeletedAt));
  if (whereId != null) where.add(PlanningCenterApiWhere.parse('id', whereId));
  if (whereName != null)
    where.add(PlanningCenterApiWhere.parse('name', whereName));
  if (whereUpdatedAt != null)
    where.add(PlanningCenterApiWhere.parse('updated_at', whereUpdatedAt));
  if (whereWorkflowCategoryId != null)
    where.add(PlanningCenterApiWhere.parse(
        'workflow_category_id', whereWorkflowCategoryId));

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