getFromServiceTypeAndPlanAndItem static method
Will get a PcoCollection
of PcoServicesAttachment objects (expecting many)
using a path like this: /services/v2/service_types/$serviceTypeId/plans/$planId/items/$itemId/attachments
Getting a PcoCollection
is useful even when retrieving a single object
because it contains error data and helper functions.
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<PcoCollection<PcoServicesAttachment>>
getFromServiceTypeAndPlanAndItem(
String serviceTypeId,
String planId,
String itemId, {
String? id,
PcoServicesAttachmentQuery? query,
bool getAll = false,
bool includeZooms = false,
}) async {
query ??= PcoServicesAttachmentQuery();
if (getAll) query.getAll = true;
if (includeZooms) query.include.add('zooms');
var url =
'/services/v2/service_types/$serviceTypeId/plans/$planId/items/$itemId/attachments';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoServicesAttachment>(url,
query: query, apiVersion: kApiVersion);
}