PcoGivingDonationQuery constructor

PcoGivingDonationQuery({
  1. bool includeDesignations = false,
  2. bool includeLabels = false,
  3. bool includeNote = false,
  4. bool includeRefund = false,
  5. bool includeAllRelated = false,
  6. String? whereCompletedAt,
  7. String? whereCreatedAt,
  8. String? wherePaymentMethod,
  9. String? whereReceivedAt,
  10. String? whereUpdatedAt,
  11. PcoGivingDonationFilter? filterBy,
  12. PcoGivingDonationOrder? 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

PcoGivingDonationQuery({
  /// include associated designations
  /// when true, adds `?include=designations` to url
  bool includeDesignations = false,

  /// include associated labels
  /// when true, adds `?include=labels` to url
  bool includeLabels = false,

  /// include associated note
  /// when true, adds `?include=note` to url
  bool includeNote = false,

  /// include associated refund
  /// when true, adds `?include=refund` to url
  bool includeRefund = false,

  /// when true, adds `?include=designations,labels,note,refund` to url parameters
  bool includeAllRelated = false,

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

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

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

  /// 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,
  PcoGivingDonationFilter? filterBy,
  PcoGivingDonationOrder? 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 || includeDesignations) include.add('designations');
  if (includeAllRelated || includeLabels) include.add('labels');
  if (includeAllRelated || includeNote) include.add('note');
  if (includeAllRelated || includeRefund) include.add('refund');

  if (whereCompletedAt != null)
    where.add(PlanningCenterApiWhere.parse('completed_at', whereCompletedAt));
  if (whereCreatedAt != null)
    where.add(PlanningCenterApiWhere.parse('created_at', whereCreatedAt));
  if (wherePaymentMethod != null)
    where.add(
        PlanningCenterApiWhere.parse('payment_method', wherePaymentMethod));
  if (whereReceivedAt != null)
    where.add(PlanningCenterApiWhere.parse('received_at', whereReceivedAt));
  if (whereUpdatedAt != null)
    where.add(PlanningCenterApiWhere.parse('updated_at', whereUpdatedAt));

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