protected function updateTeam(
        string $project,
        string $langCode,
        array $members,
        bool $skipInvalidUsername,
        string $team
    ): ResponseInterface {
        // Make sure the $members array is not empty
        if (!\count($members)) {
            throw new \InvalidArgumentException("The $team array must contain at least one username.");
        }

        $uri = $this->createUri("/api/2/project/$project/language/$langCode/$team/");

        if ($skipInvalidUsername) {
            $uri = $uri->withQuery('skip_invalid_username');
        }

        $request = $this->createRequest('PUT', $uri);
        $request = $request->withBody($this->streamFactory->createStream(\json_encode($members)));
        $request = $request->withHeader('Content-Type', 'application/json');

        return $this->client->sendRequest($request);
    }