public function updateRegistration(RegistrationInterface $registration)
    {
        if (!$registration->getRegistrationId()) {
            throw new \RuntimeException('Registration ID is mandatory.');
        }

        $uri = $registration->buildUri($this->endpoint, $this->hubPath).self::API_VERSION;

        $token = $this->generateSasToken($uri);
        $headers = array_merge(['Authorization: '.$token], $registration->getHeaders());

        $response = $this->request(self::METHOD_PUT, $uri, $headers, $registration->getPayload());

        return $registration->scrapeResponse($response);
    }