getFromResource static method
Future<PcoCollection<PcoCalendarRequiredApproval> >
getFromResource(
- String resourceId,
- {String? id,
- PcoCalendarRequiredApprovalQuery? query,
- bool getAll = false,
- bool includeResource = false}
Will get a PcoCollection
of PcoCalendarRequiredApproval objects (expecting many)
using a path like this: /calendar/v2/resources/$resourceId/required_approvals
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<PcoCalendarRequiredApproval>> getFromResource(
String resourceId, {
String? id,
PcoCalendarRequiredApprovalQuery? query,
bool getAll = false,
bool includeResource = false,
}) async {
query ??= PcoCalendarRequiredApprovalQuery();
if (getAll) query.getAll = true;
if (includeResource) query.include.add('resource');
var url = '/calendar/v2/resources/$resourceId/required_approvals';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoCalendarRequiredApproval>(url,
query: query, apiVersion: kApiVersion);
}