getSingle static method

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

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