getAllFromLabel static method

Future<PcoCollection<PcoCheckInsLocationLabel>> getAllFromLabel(
  1. String labelId,
  2. {String? id,
  3. PcoCheckInsLocationLabelQuery? query,
  4. bool includeAllRelated = false,
  5. bool includeLabel = false,
  6. bool includeLocation = false}
)

Will get a PcoCollection containing ALL PcoCheckInsLocationLabel objects (expecting many) using a path like this: /check-ins/v2/labels/$labelId/location_labels

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.

This function forces the query.getAll to be true.

Implementation

static Future<PcoCollection<PcoCheckInsLocationLabel>> getAllFromLabel(
  String labelId, {
  String? id,
  PcoCheckInsLocationLabelQuery? query,
  bool includeAllRelated = false,
  bool includeLabel = false,
  bool includeLocation = false,
}) async {
  query ??= PcoCheckInsLocationLabelQuery();
  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);
}