deleteRelationship method

Future<void> deleteRelationship({
  1. required String relationName,
  2. required String sourceType,
  3. required String sourceKey,
  4. required String targetType,
  5. required String targetKey,
  6. String? sourceStatus,
  7. String? targetStatus,
  8. int? sourceVersion,
  9. int? targetVersion,
})

Deletes a relationship between two entities (user, space, content).

Permissions required: Permission to access the Confluence site ('Can use' global permission). For favourite relationships, the current user can only delete their own favourite relationships. A space administrator can delete favourite relationships for any user.

Implementation

Future<void> deleteRelationship(
    {required String relationName,
    required String sourceType,
    required String sourceKey,
    required String targetType,
    required String targetKey,
    String? sourceStatus,
    String? targetStatus,
    int? sourceVersion,
    int? targetVersion}) async {
  await _client.send(
    'delete',
    'wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}/{targetKey}',
    pathParameters: {
      'relationName': relationName,
      'sourceType': sourceType,
      'sourceKey': sourceKey,
      'targetType': targetType,
      'targetKey': targetKey,
    },
    queryParameters: {
      if (sourceStatus != null) 'sourceStatus': sourceStatus,
      if (targetStatus != null) 'targetStatus': targetStatus,
      if (sourceVersion != null) 'sourceVersion': '$sourceVersion',
      if (targetVersion != null) 'targetVersion': '$targetVersion',
    },
  );
}