PcoServicesServiceTypeQuery constructor

PcoServicesServiceTypeQuery({
  1. bool includeTimePreferenceOptions = false,
  2. String? whereId,
  3. String? whereName,
  4. PcoServicesServiceTypeFilter? filterBy,
  5. PcoServicesServiceTypeOrder? orderBy,
  6. bool reverse = false,
  7. int perPage = 25,
  8. int pageOffset = 0,
  9. Map<String, String> extraParams = const {},
  10. List<PlanningCenterApiWhere>? where,
  11. Iterable<String> filter = const <String>[],
  12. String? order,
  13. Iterable<String> include = const <String>[],
})

Implementation

PcoServicesServiceTypeQuery({
  /// include associated time_preference_options
  /// when true, adds `?include=time_preference_options` to url
  bool includeTimePreferenceOptions = false,

  /// 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 `name`
  /// query on a specific name, url example: ?where[name]=string
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereName,
  PcoServicesServiceTypeFilter? filterBy,
  PcoServicesServiceTypeOrder? 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 (includeTimePreferenceOptions) include.add('time_preference_options');

  if (whereId != null) where.add(PlanningCenterApiWhere.parse('id', whereId));
  if (whereName != null)
    where.add(PlanningCenterApiWhere.parse('name', whereName));

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