getFromGroup static method
Future<PcoCollection<PcoGroupsResource> >
getFromGroup(
- String groupId, {
- String? id,
- PcoGroupsResourceQuery? query,
- bool getAll = false,
Will get a PcoCollection
of PcoGroupsResource objects (expecting many)
using a path like this: /groups/v2/groups/$groupId/resources
Available Query Filters:
leaders
filter resources only visible to group leaders
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<PcoGroupsResource>> getFromGroup(
String groupId, {
String? id,
PcoGroupsResourceQuery? query,
bool getAll = false,
}) async {
query ??= PcoGroupsResourceQuery();
if (getAll) query.getAll = true;
var url = '/groups/v2/groups/$groupId/resources';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoGroupsResource>(url,
query: query, apiVersion: kApiVersion);
}