get static method

Future<PcoCollection<PcoGroupsEvent>> get({
  1. String? id,
  2. PcoGroupsEventQuery? query,
  3. bool getAll = false,
  4. bool includeAllRelated = false,
  5. bool includeGroup = false,
  6. bool includeLocation = false,
})

Will get a PcoCollection of PcoGroupsEvent objects (expecting many) using a path like this: /groups/v2/events

Available Query Filters:

  • canceled

  • 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

  • not_canceled

  • upcoming

Getting a PcoCollection is useful even when retrieving a single object because it contains error data and helper functions.

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.

Implementation

static Future<PcoCollection<PcoGroupsEvent>> get({
  String? id,
  PcoGroupsEventQuery? query,
  bool getAll = false,
  bool includeAllRelated = false,
  bool includeGroup = false,
  bool includeLocation = false,
}) async {
  query ??= PcoGroupsEventQuery();
  if (getAll) 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);
}