'Create a hook on this repository.
:param str name: (required), name of the hook
:param dict config: (required), key-value pairs which act as settings
for this hook
:param list events: (optional), events the hook is triggered for
:param bool active: (optional), whether the hook is actually
triggered
:returns: :class:`Hook <github3.repos.hook.Hook>` if successful,
otherwise None'

@requires_auth
def create_hook(self, name, config, events=[u'push'], active=True):

    json = None
    if (name and config and isinstance(config, dict)):
        url = self._build_url(u'hooks', base_url=self._api)
        data = {u'name': name, u'config': config, u'events': events, u'active': active}
        json = self._json(self._post(url, data=data), 201)
    return (Hook(json, self) if json else None)
