getFromEvent static method

Future<PcoCollection<PcoGroupsLocation>> getFromEvent(
  1. String eventId, {
  2. String? id,
  3. PcoGroupsLocationQuery? query,
  4. bool getAll = false,
})

Will get a PcoCollection of PcoGroupsLocation objects (expecting many) using a path like this: /groups/v2/events/$eventId/location

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<PcoGroupsLocation>> getFromEvent(
  String eventId, {
  String? id,
  PcoGroupsLocationQuery? query,
  bool getAll = false,
}) async {
  query ??= PcoGroupsLocationQuery();
  if (getAll) query.getAll = true;

  var url = '/groups/v2/events/$eventId/location';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoGroupsLocation>(url,
      query: query, apiVersion: kApiVersion);
}