docs: def delete_object(self, bucket, obj, version_id):
          """Delete an existing object.
  
          :param bucket: The bucket (instance or id) to get the object from.
          :param obj: A :class:`invenio_files_rest.models.ObjectVersion`
              instance.
          :param version_id: The version ID.
          :returns: A Flask response.
          """
          if version_id is None:
              # Create a delete marker.
              with db.session.begin_nested():
                  ObjectVersion.delete(bucket, obj.key)
              db.session.commit()
          else:
              # Permanently delete specific object version.
              check_permission(
                  current_permission_factory(bucket, 'object-delete-version'),
                  hidden=False,
              )
              obj.remove()
              db.session.commit()
              if obj.file_id:
                  remove_file_data.delay(str(obj.file_id))
  
          return self.make_response('', 204)