deleteToOne method

Future<RelationshipUpdated<ToOne>> deleteToOne(
  1. String type,
  2. String id,
  3. String relationship, {
  4. Map<String, List<String>> headers = const {},
  5. Iterable<QueryEncodable> query = const [],
})

Removes the to-one relationship identified by type, id, and relationship..

Optional arguments:

  • headers - any extra HTTP headers
  • query - a collection of parameters to be included in the URI query

Implementation

Future<RelationshipUpdated<ToOne>> deleteToOne(
  String type,
  String id,
  String relationship, {
  Map<String, List<String>> headers = const {},
  Iterable<QueryEncodable> query = const [],
}) async {
  final response = await send(
      _baseUri.relationship(type, id, relationship),
      Request.patch(OutboundDataDocument.one(ToOne.empty()))
        ..headers.addAll(headers)
        ..query.mergeAll(query));
  return RelationshipUpdated.one(response.httpResponse, response.document);
}