getFromRoomSetup static method

Future<PcoCollection<PcoCalendarResourceSuggestion>> getFromRoomSetup(
  1. String roomSetupId,
  2. {String? id,
  3. PcoCalendarResourceSuggestionQuery? query,
  4. bool getAll = false,
  5. bool includeResource = false}
)

Will get a PcoCollection of PcoCalendarResourceSuggestion objects (expecting many) using a path like this: /calendar/v2/room_setups/$roomSetupId/resource_suggestions

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<PcoCalendarResourceSuggestion>> getFromRoomSetup(
  String roomSetupId, {
  String? id,
  PcoCalendarResourceSuggestionQuery? query,
  bool getAll = false,
  bool includeResource = false,
}) async {
  query ??= PcoCalendarResourceSuggestionQuery();
  if (getAll) query.getAll = true;

  if (includeResource) query.include.add('resource');
  var url = '/calendar/v2/room_setups/$roomSetupId/resource_suggestions';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCalendarResourceSuggestion>(url,
      query: query, apiVersion: kApiVersion);
}