getSingleFromServiceTypeAndPlanAndItem static method

Future<PcoServicesCustomSlide?> getSingleFromServiceTypeAndPlanAndItem(
  1. String serviceTypeId,
  2. String planId,
  3. String itemId,
  4. String id, {
  5. PcoServicesCustomSlideQuery? query,
})

Will get a single PcoServicesCustomSlide object using a path like this: /services/v2/service_types/$serviceTypeId/plans/$planId/items/$itemId/custom_slides/[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<PcoServicesCustomSlide?> getSingleFromServiceTypeAndPlanAndItem(
  String serviceTypeId,
  String planId,
  String itemId,
  String id, {
  PcoServicesCustomSlideQuery? query,
}) async {
  query ??= PcoServicesCustomSlideQuery();

  var url =
      '/services/v2/service_types/$serviceTypeId/plans/$planId/items/$itemId/custom_slides/$id';
  var retval = await PcoCollection.fromApiCall<PcoServicesCustomSlide>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}