RestRequestTransformer class abstract
Specify request formatting (such as method
or url
) for each Brick operation.
This class should be subclassed for each model. For example:
@RestSerializable(
requestTransformer: MyModelOperationTransformer.new,
)
class MyModel extends RestModel {}
class MyModelOperationTransformer extends RestRequestTransformer<MyModel> {
final get = RestRequest(
url: 'https://myapi.com/mymodel'
);
}
Constructors
- RestRequestTransformer(Query? query, Model? instance)
-
const
Properties
- delete → RestRequest?
-
The operation used for any destructive data operations.
no setter
- get → RestRequest?
-
The operation used for any single-fetch data operations for index
or collection instances.
RestProvider#exists
also uses this property.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- instance → Model?
-
The model being sent to the REST API; this will
only be non-null for upsert and delete operations.
final
- query → Query?
-
A query provided with the provider or repository request.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- upsert → RestRequest?
-
The operation used for any inserting or updating data operations.
no setter
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