'Edit this hook.
:param dict config: (optional), key-value pairs of settings for this
hook
:param list events: (optional), which events should this be triggered
for
:param list add_events: (optional), events to be added to the list of
events that this hook triggers for
:param list rm_events: (optional), events to be removed from the list
of events that this hook triggers for
:param bool active: (optional), should this event be active
:returns: bool'

@requires_auth
def edit(self, config={}, events=[], add_events=[], rm_events=[], active=True):

    data = {u'config': config, u'active': active}
    if events:
        data[u'events'] = events
    if add_events:
        data[u'add_events'] = add_events
    if rm_events:
        data[u'remove_events'] = rm_events
    json = self._json(self._patch(self._api, data=dumps(data)), 200)
    if json:
        self._update_attributes(json)
        return True
    return False
