get static method
Future<PcoCollection<PcoPeopleList> >
get(
- {String? id,
- PcoPeopleListQuery? query,
- bool getAll = false,
- bool includeAllRelated = false,
- bool includeCampus = false,
- bool includeCategory = false,
- bool includeCreatedBy = false,
- bool includeMailchimpSyncStatus = false,
- bool includePeople = false,
- bool includeRules = false,
- bool includeUpdatedBy = false}
Will get a PcoCollection
of PcoPeopleList objects (expecting many)
using a path like this: /people/v2/lists
Available Query Filters:
can_manage
recently_viewed
starred
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<PcoPeopleList>> get({
String? id,
PcoPeopleListQuery? query,
bool getAll = false,
bool includeAllRelated = false,
bool includeCampus = false,
bool includeCategory = false,
bool includeCreatedBy = false,
bool includeMailchimpSyncStatus = false,
bool includePeople = false,
bool includeRules = false,
bool includeShares = false,
bool includeUpdatedBy = false,
}) async {
query ??= PcoPeopleListQuery();
if (getAll) query.getAll = true;
if (includeAllRelated) query.include.addAll(PcoPeopleList.canInclude);
if (includeCampus) query.include.add('campus');
if (includeCategory) query.include.add('category');
if (includeCreatedBy) query.include.add('created_by');
if (includeMailchimpSyncStatus) query.include.add('mailchimp_sync_status');
if (includePeople) query.include.add('people');
if (includeRules) query.include.add('rules');
if (includeShares) query.include.add('shares');
if (includeUpdatedBy) query.include.add('updated_by');
var url = '/people/v2/lists';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoPeopleList>(url,
query: query, apiVersion: kApiVersion);
}