listCollections method

Future<GeofencePage<GeofenceCollection>> listCollections({
  1. int? maxResults,
  2. String? nextToken,
})

Lists the account's collections.

Implementation

Future<GeofencePage<GeofenceCollection>> listCollections({
  int? maxResults,
  String? nextToken,
}) async {
  final json = await _transport.sendJson(
    operation: 'ListGeofenceCollections',
    service: _control,
    method: 'POST',
    path: '/geofencing/v0/list-collections',
    body: <String, dynamic>{
      'MaxResults': ?maxResults,
      'NextToken': ?nextToken,
    },
  );
  return GeofencePage<GeofenceCollection>(
    items: Json.objects(
      json,
      'Entries',
    ).map(GeofenceCollection.fromJson).toList(growable: false),
    nextToken: Json.string(json, 'NextToken'),
  );
}