public function createStatus($owner, $repo, $id, $state, $targetUrl = '', $description = '')
	{
		$allowedStates = array('pending', 'success', 'error', 'failure');

		// Build the request path.
		$path = "/repos/$owner/$repo/deployments/" . (int) $id . '/statuses';

		if (!\in_array($state, $allowedStates))
		{
			throw new \InvalidArgumentException(sprintf('The deployment state must be: %s', implode(', ', $allowedStates)));
		}

		$data = array(
			'state' => $state,
		);

		if ($targetUrl)
		{
			$data['target_url'] = $targetUrl;
		}

		if ($description)
		{
			$data['description'] = $description;
		}

		return $this->processResponse(
			$this->client->post($this->fetchUrl($path), json_encode($data)),
			201
		);
	}