PcoCalendarEventResourceRequestQuery constructor

PcoCalendarEventResourceRequestQuery({
  1. bool includeCreatedBy = false,
  2. bool includeEvent = false,
  3. bool includeResource = false,
  4. bool includeRoomSetup = false,
  5. bool includeUpdatedBy = false,
  6. bool includeAllRelated = false,
  7. String? whereApprovalSent,
  8. String? whereApprovalStatus,
  9. String? whereCreatedAt,
  10. String? whereUpdatedAt,
  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

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

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

  /// include associated resource
  /// when true, adds `?include=resource` to url
  bool includeResource = false,

  /// include associated room_setup
  /// when true, adds `?include=room_setup` to url
  bool includeRoomSetup = false,

  /// include associated updated_by
  /// when true, adds `?include=updated_by` to url
  bool includeUpdatedBy = false,

  /// when true, adds `?include=created_by,event,resource,room_setup,updated_by` to url parameters
  bool includeAllRelated = false,

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

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

  /// 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 (includeAllRelated || includeCreatedBy) include.add('created_by');
  if (includeAllRelated || includeEvent) include.add('event');
  if (includeAllRelated || includeResource) include.add('resource');
  if (includeAllRelated || includeRoomSetup) include.add('room_setup');
  if (includeAllRelated || includeUpdatedBy) include.add('updated_by');

  if (whereApprovalSent != null)
    where.add(
        PlanningCenterApiWhere.parse('approval_sent', whereApprovalSent));
  if (whereApprovalStatus != null)
    where.add(
        PlanningCenterApiWhere.parse('approval_status', whereApprovalStatus));
  if (whereCreatedAt != null)
    where.add(PlanningCenterApiWhere.parse('created_at', whereCreatedAt));
  if (whereUpdatedAt != null)
    where.add(PlanningCenterApiWhere.parse('updated_at', whereUpdatedAt));
}