getAllFromGroupType static method

Future<PcoCollection<PcoGroupsResource>> getAllFromGroupType(
  1. String groupTypeId, {
  2. String? id,
  3. PcoGroupsResourceQuery? query,
})

Will get a PcoCollection containing ALL PcoGroupsResource objects (expecting many) using a path like this: /groups/v2/group_types/$groupTypeId/resources

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.

This function forces the query.getAll to be true.

Implementation

static Future<PcoCollection<PcoGroupsResource>> getAllFromGroupType(
  String groupTypeId, {
  String? id,
  PcoGroupsResourceQuery? query,
}) async {
  query ??= PcoGroupsResourceQuery();
  query.getAll = true;

  var url = '/groups/v2/group_types/$groupTypeId/resources';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoGroupsResource>(url,
      query: query, apiVersion: kApiVersion);
}