PcoCalendarAttachmentQuery constructor

PcoCalendarAttachmentQuery(
  1. {bool includeEvent = false,
  2. String? whereContentType,
  3. String? whereCreatedAt,
  4. String? whereDescription,
  5. String? whereFileSize,
  6. String? whereName,
  7. String? whereUpdatedAt,
  8. PcoCalendarAttachmentOrder? orderBy,
  9. bool reverse = false,
  10. int perPage = 25,
  11. int pageOffset = 0,
  12. Map<String, String> extraParams = const {},
  13. List<PlanningCenterApiWhere>? where,
  14. Iterable<String> filter = const <String>[],
  15. String? order,
  16. Iterable<String> include = const <String>[]}
)

Implementation

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

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

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

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

  /// 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,
  PcoCalendarAttachmentOrder? 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 (includeEvent) include.add('event');

  if (whereContentType != null)
    where.add(PlanningCenterApiWhere.parse('content_type', whereContentType));
  if (whereCreatedAt != null)
    where.add(PlanningCenterApiWhere.parse('created_at', whereCreatedAt));
  if (whereDescription != null)
    where.add(PlanningCenterApiWhere.parse('description', whereDescription));
  if (whereFileSize != null)
    where.add(PlanningCenterApiWhere.parse('file_size', whereFileSize));
  if (whereName != null)
    where.add(PlanningCenterApiWhere.parse('name', whereName));
  if (whereUpdatedAt != null)
    where.add(PlanningCenterApiWhere.parse('updated_at', whereUpdatedAt));

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