getFromResourceApprovalGroup static method
Will get a PcoCollection
of PcoCalendarEventResourceRequest objects (expecting many)
using a path like this: /calendar/v2/resource_approval_groups/$resourceApprovalGroupId/event_resource_requests
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<PcoCalendarEventResourceRequest>>
getFromResourceApprovalGroup(
String resourceApprovalGroupId, {
String? id,
PcoCalendarEventResourceRequestQuery? query,
bool getAll = false,
bool includeAllRelated = false,
bool includeCreatedBy = false,
bool includeEvent = false,
bool includeResource = false,
bool includeRoomSetup = false,
bool includeUpdatedBy = false,
}) async {
query ??= PcoCalendarEventResourceRequestQuery();
if (getAll) query.getAll = true;
if (includeAllRelated)
query.include.addAll(PcoCalendarEventResourceRequest.canInclude);
if (includeCreatedBy) query.include.add('created_by');
if (includeEvent) query.include.add('event');
if (includeResource) query.include.add('resource');
if (includeRoomSetup) query.include.add('room_setup');
if (includeUpdatedBy) query.include.add('updated_by');
var url =
'/calendar/v2/resource_approval_groups/$resourceApprovalGroupId/event_resource_requests';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoCalendarEventResourceRequest>(url,
query: query, apiVersion: kApiVersion);
}