getSingle static method

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

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

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