getVisitFromGroupTypeAndResource static method

Future<PcoCollection<PcoGroupsResource>> getVisitFromGroupTypeAndResource(
  1. String groupTypeId,
  2. String resourceId, {
  3. PcoGroupsResourceQuery? query,
  4. bool getAll = false,
})

Will get a PcoCollection of PcoGroupsResource objects (expecting one) using a path like this: /groups/v2/group_types/$groupTypeId/resources/$resourceId/visit

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>>
    getVisitFromGroupTypeAndResource(
  String groupTypeId,
  String resourceId, {
  PcoGroupsResourceQuery? query,
  bool getAll = false,
}) async {
  query ??= PcoGroupsResourceQuery();
  if (getAll) query.getAll = true;

  var url = '/groups/v2/group_types/$groupTypeId/resources/$resourceId/visit';

  return PcoCollection.fromApiCall<PcoGroupsResource>(url,
      query: query, apiVersion: kApiVersion);
}