public function updateRole($projectId, $roleId, $user = null, $group = null)
    {
        $parameters = [];
        if ((is_null($user) && is_null($group)) || (!is_null($user) && !is_null($group))) {
            throw new EndpointParameterException('User or group should be given');
        } elseif (!is_null($user)) {
            $parameters['user'] = $user;
        } else {
            $parameters['group'] = $group;
        }

        return $this->apiClient->callEndpoint(
            sprintf('%s/%s/role/%s', self::ENDPOINT, $projectId, $roleId),
            $parameters,
            null,
            HttpMethod::REQUEST_PUT
        );
    }