get static method

Future<PcoCollection<PcoCalendarEventResourceRequest>> get({
  1. String? id,
  2. PcoCalendarEventResourceRequestQuery? query,
  3. bool getAll = false,
  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 of PcoCalendarEventResourceRequest objects (expecting many) using a path like this: /calendar/v2/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>> get({
  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/event_resource_requests';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCalendarEventResourceRequest>(url,
      query: query, apiVersion: kApiVersion);
}