ListApiResource<TData, TId> constructor

ListApiResource<TData, TId>(
  1. RoutePattern path,
  2. TransferBean<TData> bean, {
  3. String idParam = 'id',
  4. bool allowPatch = true,
  5. bool allowPost = true,
  6. bool allowDelete = true,
})

Implementation

ListApiResource(RoutePattern path, TransferBean<TData> bean,
    {this.idParam = 'id',
    bool allowPatch = true,
    bool allowPost = true,
    bool allowDelete = true})
    : super._(path, bean, allowPatch, allowPost, allowDelete) {
  if (!path.containsParam(idParam)) {
    throw ApiError(
        'ApiResource path does not contain the id placeholder: $idParam');
  }

  if (TId != String && TId != int) {
    throw ApiError('ApiResource only allows int or String as id type.');
  }
}