replaceToMany method
Replaces the to-many relationship
identified by type
, id
, and relationship
by setting
the new identifiers
.
Optional arguments:
meta
- relationship metadataheaders
- any extra HTTP headersquery
- a collection of parameters to be included in the URI query
Implementation
Future<RelationshipUpdated<ToMany>> 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 [],
}) async =>
RelationshipUpdated.many(await send(
_baseUri.relationship(type, id, relationship),
Request.patch(
OutboundDataDocument.many(ToMany(identifiers)..meta.addAll(meta)))
..headers.addAll(headers)
..query.mergeAll(query)));