'PUT /api/repository_revisions/{encoded_repository_metadata_id}/{payload}
Updates the value of specified columns of the repository_metadata table based on the key / value pairs in payload.
:param id: the encoded id of the `RepositoryMetadata` object'

@web.expose_api
def update(self, trans, payload, **kwd):

    repository_metadata_id = kwd.get('id', None)
    if (repository_metadata_id is None):
        raise HTTPBadRequest(detail="Missing    required    parameter    'id'.")
    repository_metadata = metadata_util.get_repository_metadata_by_id(trans.app, repository_metadata_id)
    if (repository_metadata is None):
        decoded_repository_metadata_id = trans.security.decode_id(repository_metadata_id)
        log.debug(('Cannot    locate    repository_metadata    with    id    %s' % str(decoded_repository_metadata_id)))
        return {}
    else:
        decoded_repository_metadata_id = repository_metadata.id
    flush_needed = False
    for (key, new_value) in payload.items():
        if hasattr(repository_metadata, key):
            if (key in ['includes_tools', 'missing_test_components']):
                log.debug(('Setting    repository_metadata    column    %s    to    value    %s    for    changeset_revision    %s    via    the    Tool    Shed    API.' % (str(key), str(new_value), str(repository_metadata.changeset_revision))))
            setattr(repository_metadata, key, new_value)
            flush_needed = True
    if flush_needed:
        log.debug(('Updating    repository_metadata    record    with    id    %s    and    changeset_revision    %s.' % (str(decoded_repository_metadata_id), str(repository_metadata.changeset_revision))))
        trans.sa_session.add(repository_metadata)
        trans.sa_session.flush()
        trans.sa_session.refresh(repository_metadata)
    repository_metadata_dict = repository_metadata.to_dict(view='element', value_mapper=self.__get_value_mapper(trans))
    repository_metadata_dict['url'] = web.url_for(controller='repository_revisions', action='show', id=repository_metadata_id)
    return repository_metadata_dict
