RestCollectionEndpoint<T, Id> class
abstract
Standardized REST collection endpoint.
This endpoint provides a REST interface for querying paged collections.
To enable single item requests by id, override getItemById and make sure
routePattern contains an id route parameter. If the parameter name is not
'id', provide the correct parameter name in idParam.
To disable single item requests use void
as Id
type parameter and
omit the id route parameter.
- Inheritance
-
- Object
- ApiEndpoint
- RestCollectionEndpoint
Constructors
- RestCollectionEndpoint(RoutePattern routePattern, {String idParam = 'id', int defaultQueryLength = 25})
Properties
- defaultQueryLength → int
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- idParam → String
-
final
- routePattern → RoutePattern
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
delete(
ApiRequest request) → Future -
inherited
-
errorResponse(
ApiRequest request, dynamic error, StackTrace stackTrace) → ApiResponse -
Wraps the execution of a request handler to ensure that an ApiResponse
is the result.
inherited
-
get(
ApiRequest request) → Future -
override
-
getItemById(
ApiRequest request, Id id) → Future< T> -
getItems(
ApiRequest request, int offset, int length) → Future< List< T> > -
getLength(
ApiRequest request) → Future< int> -
handleRequest(
ApiRequest request) → Future< ApiResponse> -
inherited
-
head(
ApiRequest request) → Future -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
options(
ApiRequest request) → Future -
inherited
-
patch(
ApiRequest request) → Future -
inherited
-
post(
ApiRequest request) → Future -
inherited
-
put(
ApiRequest request) → Future -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
trace(
ApiRequest request) → Future -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited