getAllFromTag static method

Future<PcoCollection<PcoCalendarTagGroup>> getAllFromTag(
  1. String tagId, {
  2. String? id,
  3. PcoCalendarTagGroupQuery? query,
  4. bool includeAllRelated = false,
  5. bool includeEvents = false,
  6. bool includeTags = false,
})

Will get a PcoCollection containing ALL PcoCalendarTagGroup objects (expecting many) using a path like this: /calendar/v2/tags/$tagId/tag_group

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<PcoCalendarTagGroup>> getAllFromTag(
  String tagId, {
  String? id,
  PcoCalendarTagGroupQuery? query,
  bool includeAllRelated = false,
  bool includeEvents = false,
  bool includeTags = false,
}) async {
  query ??= PcoCalendarTagGroupQuery();
  query.getAll = true;
  if (includeAllRelated) query.include.addAll(PcoCalendarTagGroup.canInclude);
  if (includeEvents) query.include.add('events');
  if (includeTags) query.include.add('tags');
  var url = '/calendar/v2/tags/$tagId/tag_group';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCalendarTagGroup>(url,
      query: query, apiVersion: kApiVersion);
}