getSingleFromTagGroup static method
Will get a single PcoCalendarEvent
object
using a path like this: /calendar/v2/tag_groups/$tagGroupId/events/[id]
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<PcoCalendarEvent?> getSingleFromTagGroup(
String tagGroupId,
String id, {
PcoCalendarEventQuery? query,
bool includeAllRelated = false,
bool includeAttachments = false,
bool includeOwner = false,
bool includeTags = false,
}) async {
query ??= PcoCalendarEventQuery();
if (includeAllRelated) query.include.addAll(PcoCalendarEvent.canInclude);
if (includeAttachments) query.include.add('attachments');
if (includeOwner) query.include.add('owner');
if (includeTags) query.include.add('tags');
var url = '/calendar/v2/tag_groups/$tagGroupId/events/$id';
var retval = await PcoCollection.fromApiCall<PcoCalendarEvent>(url,
query: query, apiVersion: kApiVersion);
return retval.items.isEmpty ? null : retval.items.first;
}