getAll static method
Future<PcoCollection<PcoGroupsEvent> >
getAll({
- String? id,
- PcoGroupsEventQuery? query,
- bool includeAllRelated = false,
- bool includeGroup = false,
- bool includeLocation = false,
Will get a PcoCollection
containing ALL PcoGroupsEvent objects (expecting many)
using a path like this: /groups/v2/events
Available Query Filters:
-
canceled
-
group
filter events from specific groups; provide an additionalgroup_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 additionalgroup_type_id
param as a comma-separated list of IDs, ex:?filter=group_type&group_type_id=1,2,3
-
my_groups
-
not_canceled
-
upcoming
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<PcoGroupsEvent>> getAll({
String? id,
PcoGroupsEventQuery? query,
bool includeAllRelated = false,
bool includeGroup = false,
bool includeLocation = false,
}) async {
query ??= PcoGroupsEventQuery();
query.getAll = true;
if (includeAllRelated) query.include.addAll(PcoGroupsEvent.canInclude);
if (includeGroup) query.include.add('group');
if (includeLocation) query.include.add('location');
var url = '/groups/v2/events';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoGroupsEvent>(url,
query: query, apiVersion: kApiVersion);
}