'delete( self, trans, history_id, id, **kwd )
* DELETE /api/histories/{history_id}/contents/{id}
delete the HDA with the given ``id``
.. note:: Currently does not stop any active jobs for which this dataset is an output.
:type   id:     str
:param  id:     the encoded id of the history to delete
:type   purge:  bool
:param  purge:  if True, purge the HDA
:type   kwd:    dict
:param  kwd:    (optional) dictionary structure containing:
* payload:     a dictionary itself containing:
* purge:   if True, purge the HDA
.. note:: that payload optionally can be placed in the query string of the request.
This allows clients that strip the request body to still purge the dataset.
:rtype:     dict
:returns:   an error object if an error occurred or a dictionary containing:
* id:         the encoded id of the history,
* deleted:    if the history was marked as deleted,
* purged:     if the history was purged'

@expose_api
def delete(self, trans, history_id, id, purge=False, **kwd):

    contents_type = kwd.get('type', 'dataset')
    if (contents_type == 'dataset'):
        return self.__delete_dataset(trans, history_id, id, purge=purge, **kwd)
    elif (contents_type == 'dataset_collection'):
        trans.app.dataset_collections_service.delete(trans, 'history', id)
        return {'id': id, 'deleted': True}
    else:
        return self.__handle_unknown_contents_type(trans, contents_type)
