getSingleFromGroup static method

Future<PcoGroupsPerson?> getSingleFromGroup(
  1. String groupId,
  2. String id, {
  3. PcoGroupsPersonQuery? query,
})

Will get a single PcoGroupsPerson object using a path like this: /groups/v2/groups/$groupId/people/[id]

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<PcoGroupsPerson?> getSingleFromGroup(
  String groupId,
  String id, {
  PcoGroupsPersonQuery? query,
}) async {
  query ??= PcoGroupsPersonQuery();

  var url = '/groups/v2/groups/$groupId/people/$id';
  var retval = await PcoCollection.fromApiCall<PcoGroupsPerson>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}