PcoPeopleFieldDefinitionQuery constructor

PcoPeopleFieldDefinitionQuery({
  1. bool includeFieldOptions = false,
  2. bool includeTab = false,
  3. bool includeAllRelated = false,
  4. String? whereConfig,
  5. String? whereDataType,
  6. String? whereDeletedAt,
  7. String? whereName,
  8. String? whereSequence,
  9. String? whereSlug,
  10. String? whereTabId,
  11. PcoPeopleFieldDefinitionFilter? filterBy,
  12. PcoPeopleFieldDefinitionOrder? orderBy,
  13. bool reverse = false,
  14. int perPage = 25,
  15. int pageOffset = 0,
  16. Map<String, String> extraParams = const {},
  17. List<PlanningCenterApiWhere>? where,
  18. Iterable<String> filter = const <String>[],
  19. String? order,
  20. Iterable<String> include = const <String>[],
})

Implementation

PcoPeopleFieldDefinitionQuery({
  /// include associated field_options
  /// when true, adds `?include=field_options` to url
  bool includeFieldOptions = false,

  /// include associated tab
  /// when true, adds `?include=tab` to url
  bool includeTab = false,

  /// when true, adds `?include=field_options,tab` to url parameters
  bool includeAllRelated = false,

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

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

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

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

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

  /// Query by `tab_id`
  /// query on a specific tab_id, url example: ?where[tab_id]=primary_key
  /// include a prefix of `<`, `<=`, `>`, `>=` to query by comparisons
  String? whereTabId,
  PcoPeopleFieldDefinitionFilter? filterBy,
  PcoPeopleFieldDefinitionOrder? 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 || includeFieldOptions) include.add('field_options');
  if (includeAllRelated || includeTab) include.add('tab');

  if (whereConfig != null)
    where.add(PlanningCenterApiWhere.parse('config', whereConfig));
  if (whereDataType != null)
    where.add(PlanningCenterApiWhere.parse('data_type', whereDataType));
  if (whereDeletedAt != null)
    where.add(PlanningCenterApiWhere.parse('deleted_at', whereDeletedAt));
  if (whereName != null)
    where.add(PlanningCenterApiWhere.parse('name', whereName));
  if (whereSequence != null)
    where.add(PlanningCenterApiWhere.parse('sequence', whereSequence));
  if (whereSlug != null)
    where.add(PlanningCenterApiWhere.parse('slug', whereSlug));
  if (whereTabId != null)
    where.add(PlanningCenterApiWhere.parse('tab_id', whereTabId));

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