getAllFromPerson static method

Future<PcoCollection<PcoCalendarEventResourceRequest>> getAllFromPerson(
  1. String personId, {
  2. String? id,
  3. PcoCalendarEventResourceRequestQuery? query,
  4. bool includeAllRelated = false,
  5. bool includeCreatedBy = false,
  6. bool includeEvent = false,
  7. bool includeResource = false,
  8. bool includeRoomSetup = false,
  9. bool includeUpdatedBy = false,
})

Will get a PcoCollection containing ALL PcoCalendarEventResourceRequest objects (expecting many) using a path like this: /calendar/v2/people/$personId/event_resource_requests

Available Query Filters:

  • awaiting_response
  • future
  • not_overbooked
  • overbooked

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<PcoCalendarEventResourceRequest>>
    getAllFromPerson(
  String personId, {
  String? id,
  PcoCalendarEventResourceRequestQuery? query,
  bool includeAllRelated = false,
  bool includeCreatedBy = false,
  bool includeEvent = false,
  bool includeResource = false,
  bool includeRoomSetup = false,
  bool includeUpdatedBy = false,
}) async {
  query ??= PcoCalendarEventResourceRequestQuery();
  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/people/$personId/event_resource_requests';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCalendarEventResourceRequest>(url,
      query: query, apiVersion: kApiVersion);
}