getSingleFromResource static method
Future<PcoCalendarResourceFolder?>
getSingleFromResource(
- String resourceId,
- String id, {
- PcoCalendarResourceFolderQuery? query,
- bool includeResources = false,
Will get a single PcoCalendarResourceFolder
object
using a path like this: /calendar/v2/resources/$resourceId/resource_folder/[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<PcoCalendarResourceFolder?> getSingleFromResource(
String resourceId,
String id, {
PcoCalendarResourceFolderQuery? query,
bool includeResources = false,
}) async {
query ??= PcoCalendarResourceFolderQuery();
if (includeResources) query.include.add('resources');
var url = '/calendar/v2/resources/$resourceId/resource_folder/$id';
var retval = await PcoCollection.fromApiCall<PcoCalendarResourceFolder>(url,
query: query, apiVersion: kApiVersion);
return retval.items.isEmpty ? null : retval.items.first;
}