replaceToOne method

Future<RelationshipUpdated<ToOne>> replaceToOne(
  1. String type,
  2. String id,
  3. String relationship,
  4. Identifier identifier, {
  5. Map<String, Object?> meta = const {},
  6. Map<String, String> headers = const {},
})

Implementation

Future<RelationshipUpdated<ToOne>> replaceToOne(
  String type,
  String id,
  String relationship,
  Identifier identifier, {
  Map<String, Object?> meta = const {},
  Map<String, String> headers = const {},
}) async {
  final response = await send(
      baseUri.relationship(type, id, relationship),
      Request.patch(
          OutboundDataDocument.one(ToOne(identifier)..meta.addAll(meta)))
        ..headers.addAll(headers));
  return RelationshipUpdated.one(response.http, response.document);
}