getAll static method

Future<PcoCollection<PcoGroupsGroup>> getAll({
  1. String? id,
  2. PcoGroupsGroupQuery? query,
  3. bool includeAllRelated = false,
  4. bool includeGroupType = false,
  5. bool includeLocation = false,
})

Will get a PcoCollection containing ALL PcoGroupsGroup objects (expecting many) using a path like this: /groups/v2/groups

Available Query Filters:

  • group filter events from specific groups; provide an additional group_id param as a comma-separated list of IDs, ex: ?filter=group&group_id=1,2,3

  • group_type filter events from specific group types; provide an additional group_type_id param as a comma-separated list of IDs, ex: ?filter=group_type&group_type_id=1,2,3

  • my_groups

Additional options may be specified by using the query argument, but some query options are also available as boolean flags in this function call too.

This function forces the query.getAll to be true.

Implementation

static Future<PcoCollection<PcoGroupsGroup>> getAll({
  String? id,
  PcoGroupsGroupQuery? query,
  bool includeAllRelated = false,
  bool includeGroupType = false,
  bool includeLocation = false,
}) async {
  query ??= PcoGroupsGroupQuery();
  query.getAll = true;
  if (includeAllRelated) query.include.addAll(PcoGroupsGroup.canInclude);
  if (includeGroupType) query.include.add('group_type');
  if (includeLocation) query.include.add('location');
  var url = '/groups/v2/groups';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoGroupsGroup>(url,
      query: query, apiVersion: kApiVersion);
}