getSingle static method

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

Will get a single PcoGroupsEvent object using a path like this: /groups/v2/events/[id]

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

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<PcoGroupsEvent?> getSingle(
  String id, {
  PcoGroupsEventQuery? query,
  bool includeAllRelated = false,
  bool includeGroup = false,
  bool includeLocation = false,
}) async {
  query ??= PcoGroupsEventQuery();
  if (includeAllRelated) query.include.addAll(PcoGroupsEvent.canInclude);
  if (includeGroup) query.include.add('group');
  if (includeLocation) query.include.add('location');
  var url = '/groups/v2/events/$id';
  var retval = await PcoCollection.fromApiCall<PcoGroupsEvent>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}