PcoCalendarEventQuery constructor

PcoCalendarEventQuery({
  1. bool includeAttachments = false,
  2. bool includeOwner = false,
  3. bool includeTags = false,
  4. bool includeAllRelated = false,
  5. String? whereApprovalStatus,
  6. String? whereCreatedAt,
  7. String? whereName,
  8. String? wherePercentApproved,
  9. String? wherePercentRejected,
  10. String? whereUpdatedAt,
  11. String? whereVisibleInChurchCenter,
  12. PcoCalendarEventFilter? filterBy,
  13. bool reverse = false,
  14. int perPage = 25,
  15. int pageOffset = 0,
  16. Map<String, String> extraParams = const {},
  17. List<PlanningCenterApiWhere>? where,
  18. Iterable<String> filter = const <String>[],
  19. String? order,
  20. Iterable<String> include = const <String>[],
})

Implementation

PcoCalendarEventQuery({
  /// include associated attachments
  /// when true, adds `?include=attachments` to url
  bool includeAttachments = false,

  /// include associated owner
  /// when true, adds `?include=owner` to url
  bool includeOwner = false,

  /// include associated tags
  /// when true, adds `?include=tags` to url
  bool includeTags = false,

  /// when true, adds `?include=attachments,owner,tags` to url parameters
  bool includeAllRelated = false,

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

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

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

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

  /// 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 `visible_in_church_center`
  /// query on a specific visible_in_church_center, url example: ?where[visible_in_church_center]=true
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereVisibleInChurchCenter,
  PcoCalendarEventFilter? filterBy,

  /// 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 || includeAttachments) include.add('attachments');
  if (includeAllRelated || includeOwner) include.add('owner');
  if (includeAllRelated || includeTags) include.add('tags');

  if (whereApprovalStatus != null)
    where.add(
        PlanningCenterApiWhere.parse('approval_status', whereApprovalStatus));
  if (whereCreatedAt != null)
    where.add(PlanningCenterApiWhere.parse('created_at', whereCreatedAt));
  if (whereName != null)
    where.add(PlanningCenterApiWhere.parse('name', whereName));
  if (wherePercentApproved != null)
    where.add(PlanningCenterApiWhere.parse(
        'percent_approved', wherePercentApproved));
  if (wherePercentRejected != null)
    where.add(PlanningCenterApiWhere.parse(
        'percent_rejected', wherePercentRejected));
  if (whereUpdatedAt != null)
    where.add(PlanningCenterApiWhere.parse('updated_at', whereUpdatedAt));
  if (whereVisibleInChurchCenter != null)
    where.add(PlanningCenterApiWhere.parse(
        'visible_in_church_center', whereVisibleInChurchCenter));
}