<?php

declare(strict_types=1);

namespace NoahVet\Reef\Jane\Exception;

class UserinfoUnauthorizedException extends UnauthorizedException
{
    /**
     * @var \NoahVet\Reef\Jane\Model\UserinfoGetResponse401
     */
    private $userinfoGetResponse401;

    /**
     * @var \Psr\Http\Message\ResponseInterface
     */
    private $response;

    public function __construct(\NoahVet\Reef\Jane\Model\UserinfoGetResponse401 $userinfoGetResponse401, \Psr\Http\Message\ResponseInterface $response)
    {
        parent::__construct('Retrieve user info from token');
        $this->userinfoGetResponse401 = $userinfoGetResponse401;
        $this->response = $response;
    }

    public function getUserinfoGetResponse401(): \NoahVet\Reef\Jane\Model\UserinfoGetResponse401
    {
        return $this->userinfoGetResponse401;
    }

    public function getResponse(): \Psr\Http\Message\ResponseInterface
    {
        return $this->response;
    }
}
