getSingle static method

Future<PcoGivingLabel?> getSingle(
  1. String id, {
  2. PcoGivingLabelQuery? query,
})

Will get a single PcoGivingLabel object using a path like this: /giving/v2/labels/[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<PcoGivingLabel?> getSingle(
  String id, {
  PcoGivingLabelQuery? query,
}) async {
  query ??= PcoGivingLabelQuery();

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