getFromPerson static method

Future<PcoCollection<PcoServicesAvailableSignup>> getFromPerson(
  1. String personId, {
  2. String? id,
  3. PcoServicesAvailableSignupQuery? query,
  4. bool getAll = false,
  5. bool includeSignupSheets = false,
})

Will get a PcoCollection of PcoServicesAvailableSignup objects (expecting many) using a path like this: /services/v2/people/$personId/available_signups

Available Query Filters:

  • current_organization

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<PcoServicesAvailableSignup>> getFromPerson(
  String personId, {
  String? id,
  PcoServicesAvailableSignupQuery? query,
  bool getAll = false,
  bool includeSignupSheets = false,
}) async {
  query ??= PcoServicesAvailableSignupQuery();
  if (getAll) query.getAll = true;

  if (includeSignupSheets) query.include.add('signup_sheets');
  var url = '/services/v2/people/$personId/available_signups';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoServicesAvailableSignup>(url,
      query: query, apiVersion: kApiVersion);
}