replaceToOne method
Replaces the to-one relationship
identified by type
, id
, and relationship
by setting
the new identifier
.
Optional arguments:
meta
- relationship metadataheaders
- any extra HTTP headersquery
- a collection of parameters to be included in the URI query
Implementation
Future<RelationshipUpdated<ToOne>> replaceToOne(
String type,
String id,
String relationship,
Identifier identifier, {
Map<String, Object?> meta = const {},
Map<String, List<String>> headers = const {},
Iterable<QueryEncodable> query = const [],
}) async =>
RelationshipUpdated.one(await send(
_baseUri.relationship(type, id, relationship),
Request.patch(
OutboundDataDocument.one(ToOne(identifier)..meta.addAll(meta)))
..headers.addAll(headers)
..query.mergeAll(query)));