PcoCalendarEventInstanceQuery constructor

PcoCalendarEventInstanceQuery({
  1. bool includeEvent = false,
  2. bool includeEventTimes = false,
  3. bool includeResourceBookings = false,
  4. bool includeTags = false,
  5. bool includeAllRelated = false,
  6. String? whereCreatedAt,
  7. String? whereEndsAt,
  8. String? whereStartsAt,
  9. String? whereUpdatedAt,
  10. PcoCalendarEventInstanceFilter? filterBy,
  11. PcoCalendarEventInstanceOrder? orderBy,
  12. bool reverse = false,
  13. int perPage = 25,
  14. int pageOffset = 0,
  15. Map<String, String> extraParams = const {},
  16. List<PlanningCenterApiWhere>? where,
  17. Iterable<String> filter = const <String>[],
  18. String? order,
  19. Iterable<String> include = const <String>[],
})

Implementation

PcoCalendarEventInstanceQuery({
  /// include associated event
  /// when true, adds `?include=event` to url
  bool includeEvent = false,

  /// include associated event_times
  /// when true, adds `?include=event_times` to url
  bool includeEventTimes = false,

  /// include associated resource_bookings
  /// when true, adds `?include=resource_bookings` to url
  bool includeResourceBookings = false,

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

  /// when true, adds `?include=event,event_times,resource_bookings,tags` to url parameters
  bool includeAllRelated = 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 `ends_at`
  /// query on a specific ends_at, url example: ?where[ends_at]=2000-01-01T12:00:00Z
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereEndsAt,

  /// Query by `starts_at`
  /// query on a specific starts_at, url example: ?where[starts_at]=2000-01-01T12:00:00Z
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereStartsAt,

  /// 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,
  PcoCalendarEventInstanceFilter? filterBy,
  PcoCalendarEventInstanceOrder? 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 || includeEvent) include.add('event');
  if (includeAllRelated || includeEventTimes) include.add('event_times');
  if (includeAllRelated || includeResourceBookings)
    include.add('resource_bookings');
  if (includeAllRelated || includeTags) include.add('tags');

  if (whereCreatedAt != null)
    where.add(PlanningCenterApiWhere.parse('created_at', whereCreatedAt));
  if (whereEndsAt != null)
    where.add(PlanningCenterApiWhere.parse('ends_at', whereEndsAt));
  if (whereStartsAt != null)
    where.add(PlanningCenterApiWhere.parse('starts_at', whereStartsAt));
  if (whereUpdatedAt != null)
    where.add(PlanningCenterApiWhere.parse('updated_at', whereUpdatedAt));

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