EndpointPreferredType enum
Endpoint preferred types for performance optimization.
If Endpoint.preferredType getter overridden and isn't null, optimal EndpointCalling created during build.
Values
- body → const EndpointPreferredType
-
The return type must be Body
- response → const EndpointPreferredType
-
The return type must be Message.
You can create a Message instance withrequest.response
function - anyEncodable → const EndpointPreferredType
-
The return type can be any json encodable instances like String, int, Map etc.
Look Body documentation for encodable objects.in endpoint
onCall
;//preferredType => anyEncodable return "hello";
equal:
return request.response(Body("hello"));
- dbResult → const EndpointPreferredType
-
The return type must be DbResult.
in endpointonCall
;//preferredType => dbResult return await db.read(..);
equal:
var dbResult = await db.read(..); return request.response(dbResult.data, headers: dbResult.headers, statusCode: dbResult.statusCode);
- accessEvent → const EndpointPreferredType
-
The return type must be AccessEvent. in endpoint
onCall
;//preferredType => accessEvent return Read(..);
equal:
var dbResult = await db.read(..); return request.response(dbResult.data, headers: dbResult.headers, statusCode: dbResult.statusCode);
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
EndpointPreferredType> - A constant List of the values in this enum, in order of their declaration.