protected function updateResource(UriInterface $uri, string $content, string $type): ResponseInterface
    {
        // Verify the content type is allowed
        if (!\in_array($type, ['string', 'file'])) {
            throw new \InvalidArgumentException('The content type must be specified as file or string.');
        }

        $request = $this->createRequest('PUT', $uri);
        $request = $request->withHeader('Content-Type', 'application/json');

        if ($type == 'file') {
            if (!\file_exists($content)) {
                throw new \InvalidArgumentException(
                    \sprintf('The specified file, "%s", does not exist.', $content)
                );
            }

            $request = $request->withBody($this->streamFactory->createStreamFromFile($content));
        } else {
            $data = [
                'content' => $content,
            ];

            $request = $request->withBody($this->streamFactory->createStream(\json_encode($data)));
        }

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