getFromLabel static method
Will get a PcoCollection
of PcoCheckInsLocationLabel objects (expecting many)
using a path like this: /check-ins/v2/labels/$labelId/location_labels
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<PcoCheckInsLocationLabel>> getFromLabel(
String labelId, {
String? id,
PcoCheckInsLocationLabelQuery? query,
bool getAll = false,
bool includeAllRelated = false,
bool includeLabel = false,
bool includeLocation = false,
}) async {
query ??= PcoCheckInsLocationLabelQuery();
if (getAll) query.getAll = true;
if (includeAllRelated)
query.include.addAll(PcoCheckInsLocationLabel.canInclude);
if (includeLabel) query.include.add('label');
if (includeLocation) query.include.add('location');
var url = '/check-ins/v2/labels/$labelId/location_labels';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoCheckInsLocationLabel>(url,
query: query, apiVersion: kApiVersion);
}