code: def delete_resource(collection, key):
      
      cls = endpoint_class(collection)
      resource = cls()
      resource = retrieve_resource(collection, key)
  
      _validate(cls, request.method, resource)
  
      try:
          _perform_database_action('delete', resource)
      except IntegrityError as exception:
          raise InvalidAPIUsage(422, FORWARDED_EXCEPTION_MESSAGE.format(
              exception))
      return no_content_response()
docs: Return the appropriate *Response* for deleting an existing resource in
      *collection*.
  
      :param string collection: a :class:`sandman.model.Model` endpoint
      :param string key: the primary key for the :class:`sandman.model.Model`
      :rtype: :class:`flask.Response`