'Toggle the public visibility of a wiki page revision'

@require_oauth2_scope('modwiki')
@validate(VModhash(), VWikiModerator(), pv=VWikiPageAndVersion(('page', 'revision')))
@api_doc(api_section.wiki, uri='/api/wiki/hide', uses_site=True)
def POST_wiki_revision_hide(self, pv):

    (page, revision) = pv
    if (not revision):
        self.handle_error(400, 'INVALID_REVISION')
    VNotInTimeout().run(action_name='wikirevise', details_text='revision_hide', target=page)
    return json.dumps({'status': revision.toggle_hide()})
