getSingle static method

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

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