RoutingClient class

A routing JSON:API client

Constructors

RoutingClient(UriDesign _baseUri, Client _client)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addMany(String type, String id, String relationship, List<Identifier> identifiers, {Map<String, Object?> meta = const {}, Map<String, List<String>> headers = const {}}) Future<RelationshipUpdated<ToMany>>
Adds the identifiers to the to-many relationship identified by type, id, relationship.
create(String type, String id, {Map<String, Object?> attributes = const {}, Map<String, Identifier> one = const {}, Map<String, Iterable<Identifier>> many = const {}, Map<String, Object?> meta = const {}, Map<String, Object?> documentMeta = const {}, Map<String, List<String>> headers = const {}, Iterable<QueryEncodable> query = const []}) Future<ResourceUpdated>
Creates a new resource with the given type and id on the server.
createNew(String type, {String? lid, Map<String, Object?> attributes = const {}, Map<String, NewIdentifier> one = const {}, Map<String, Iterable<NewIdentifier>> many = const {}, Map<String, Object?> meta = const {}, Map<String, Object?> documentMeta = const {}, Map<String, List<String>> headers = const {}, Iterable<QueryEncodable> query = const []}) Future<ResourceCreated>
Creates a new resource in the collection of type type. The server is responsible for assigning the resource id.
deleteFromMany(String type, String id, String relationship, List<Identifier> identifiers, {Map<String, Object?> meta = const {}, Map<String, List<String>> headers = const {}}) Future<RelationshipUpdated<Relationship>>
Deletes the identifiers from the to-many relationship identified by type, id, relationship.
deleteResource(String type, String id, {Map<String, List<String>> headers = const {}, Iterable<QueryEncodable> query = const []}) Future<Response>
Deletes the resource identified by type and id.
deleteToOne(String type, String id, String relationship, {Map<String, List<String>> headers = const {}, Iterable<QueryEncodable> query = const []}) Future<RelationshipUpdated<ToOne>>
Removes the to-one relationship identified by type, id, and relationship..
fetchCollection(String type, {Map<String, List<String>> headers = const {}, Iterable<QueryEncodable> query = const []}) Future<CollectionFetched>
Fetches the primary collection of type type.
fetchRelatedCollection(String type, String id, String relationship, {Map<String, List<String>> headers = const {}, Iterable<QueryEncodable> query = const []}) Future<CollectionFetched>
Fetches the related resource collection identified by type, id, relationship.
fetchRelatedResource(String type, String id, String relationship, {Map<String, List<String>> headers = const {}, Iterable<QueryEncodable> query = const []}) Future<RelatedResourceFetched>
Fetches the related resource identified by type, id, relationship.
fetchResource(String type, String id, {Map<String, List<String>> headers = const {}, Iterable<QueryEncodable> query = const []}) Future<ResourceFetched>
Fetches the resource identified by type and id.
fetchToMany(String type, String id, String relationship, {Map<String, List<String>> headers = const {}, Iterable<QueryEncodable> query = const []}) Future<RelationshipFetched<ToMany>>
Fetches the to-many relationship identified by type, id, relationship.
fetchToOne(String type, String id, String relationship, {Map<String, List<String>> headers = const {}, Iterable<QueryEncodable> query = const []}) Future<RelationshipFetched<ToOne>>
Fetches the to-one relationship identified by type, id, relationship.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
replaceToMany(String type, String id, String relationship, Iterable<Identifier> identifiers, {Map<String, Object?> meta = const {}, Map<String, List<String>> headers = const {}, Iterable<QueryEncodable> query = const []}) Future<RelationshipUpdated<ToMany>>
Replaces the to-many relationship identified by type, id, and relationship by setting the new identifiers.
replaceToOne(String type, String id, String relationship, Identifier identifier, {Map<String, Object?> meta = const {}, Map<String, List<String>> headers = const {}, Iterable<QueryEncodable> query = const []}) Future<RelationshipUpdated<ToOne>>
Replaces the to-one relationship identified by type, id, and relationship by setting the new identifier.
send(Uri uri, Request request) Future<Response>
Sends the request to the uri on the server. This method can be used to send any non-standard requests.
toString() String
A string representation of this object.
inherited
updateResource(String type, String id, {Map<String, Object?> attributes = const {}, Map<String, Identifier> one = const {}, Map<String, Iterable<Identifier>> many = const {}, Map<String, Object?> meta = const {}, Map<String, Object?> documentMeta = const {}, Map<String, List<String>> headers = const {}, Iterable<QueryEncodable> query = const []}) Future<ResourceUpdated>
Updates the resource identified by type and id.

Operators

operator ==(Object other) bool
The equality operator.
inherited