PcoServicesMediaQuery constructor

PcoServicesMediaQuery({
  1. bool includeAttachments = false,
  2. String? whereCreatorName,
  3. String? whereId,
  4. String? whereThemes,
  5. String? whereTitle,
  6. PcoServicesMediaFilter? filterBy,
  7. PcoServicesMediaOrder? orderBy,
  8. bool reverse = false,
  9. int perPage = 25,
  10. int pageOffset = 0,
  11. Map<String, String> extraParams = const {},
  12. List<PlanningCenterApiWhere>? where,
  13. Iterable<String> filter = const <String>[],
  14. String? order,
  15. Iterable<String> include = const <String>[],
})

Implementation

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

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

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

  /// Query by `title`
  /// query on a specific title, url example: ?where[title]=string
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereTitle,
  PcoServicesMediaFilter? filterBy,
  PcoServicesMediaOrder? 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 (includeAttachments) include.add('attachments');

  if (whereCreatorName != null)
    where.add(PlanningCenterApiWhere.parse('creator_name', whereCreatorName));
  if (whereId != null) where.add(PlanningCenterApiWhere.parse('id', whereId));
  if (whereThemes != null)
    where.add(PlanningCenterApiWhere.parse('themes', whereThemes));
  if (whereTitle != null)
    where.add(PlanningCenterApiWhere.parse('title', whereTitle));

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