getSingleFromServiceTypeAndPlan static method
Future<PcoServicesAttachment?>
getSingleFromServiceTypeAndPlan(
- String serviceTypeId,
- String planId,
- String id, {
- PcoServicesAttachmentQuery? query,
- bool includeZooms = false,
Will get a single PcoServicesAttachment
object
using a path like this: /services/v2/service_types/$serviceTypeId/plans/$planId/attachments/[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<PcoServicesAttachment?> getSingleFromServiceTypeAndPlan(
String serviceTypeId,
String planId,
String id, {
PcoServicesAttachmentQuery? query,
bool includeZooms = false,
}) async {
query ??= PcoServicesAttachmentQuery();
if (includeZooms) query.include.add('zooms');
var url =
'/services/v2/service_types/$serviceTypeId/plans/$planId/attachments/$id';
var retval = await PcoCollection.fromApiCall<PcoServicesAttachment>(url,
query: query, apiVersion: kApiVersion);
return retval.items.isEmpty ? null : retval.items.first;
}