getFromGroup static method

Future<PcoCollection<PcoGroupsGroupType>> getFromGroup(
  1. String groupId, {
  2. String? id,
  3. PcoGroupsGroupTypeQuery? query,
  4. bool getAll = false,

Will get a PcoCollection of PcoGroupsGroupType objects (expecting many) using a path like this: /groups/v2/groups/$groupId/group_type

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.


static Future<PcoCollection<PcoGroupsGroupType>> getFromGroup(
  String groupId, {
  String? id,
  PcoGroupsGroupTypeQuery? query,
  bool getAll = false,
}) async {
  query ??= PcoGroupsGroupTypeQuery();
  if (getAll) query.getAll = true;

  var url = '/groups/v2/groups/$groupId/group_type';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoGroupsGroupType>(url,
      query: query, apiVersion: kApiVersion);