public function edit($user, $repo, $id, $name, $config, array $events = array('push'), array $addEvents = array(),
		array $removeEvents = array(), $active = true
	)
	{
		// Check to ensure all events are in the allowed list
		foreach ($events as $event)
		{
			if (!\in_array($event, $this->hookEvents))
			{
				throw new \RuntimeException('Your events array contains an unauthorized event.');
			}
		}

		foreach ($addEvents as $event)
		{
			if (!\in_array($event, $this->hookEvents))
			{
				throw new \RuntimeException('Your active_events array contains an unauthorized event.');
			}
		}

		foreach ($removeEvents as $event)
		{
			if (!\in_array($event, $this->hookEvents))
			{
				throw new \RuntimeException('Your remove_events array contains an unauthorized event.');
			}
		}

		// Build the request path.
		$path = '/repos/' . $user . '/' . $repo . '/hooks/' . $id;

		$data = json_encode(
			array(
				'name'          => $name,
				'config'        => $config,
				'events'        => $events,
				'add_events'    => $addEvents,
				'remove_events' => $removeEvents,
				'active'        => $active,
			)
		);

		return $this->processResponse(
			$this->client->patch($this->fetchUrl($path), $data)
		);
	}