<?php

namespace Fifa\ConnectId\Sdk\Exception;

use Fifa\ConnectId\Sdk\Api\ApiException;
use Fifa\ConnectId\Sdk\Api\Model\TooManyRequestsResponseType;

class TooManyRequestsException extends FifaConnectIdException
{
    /**
     * @var TooManyRequestsResponseType
     */
    private $tooManyRequestsResponseType;

    /**
     * @var int
     */
    private $retryAfter;

    /**
     * TooManyRequestsException constructor.
     * @param ApiException $apiException
     * @param TooManyRequestsResponseType $tooManyRequestsResponseType
     * @param int $retryAfter
     */
    public function __construct(ApiException $apiException, TooManyRequestsResponseType $tooManyRequestsResponseType, $retryAfter)
    {
        parent::__construct($apiException);
        $this->tooManyRequestsResponseType = $tooManyRequestsResponseType;
        $this->retryAfter = $retryAfter;
    }

    /**
     * Response
     *
     * @return TooManyRequestsResponseType
     */
    public function getTooManyRequestsResponseType(): TooManyRequestsResponseType
    {
        return $this->tooManyRequestsResponseType;
    }

    /**
     * Amount of seconds after which an operation can be retried
     *
     * @return int
     */
    public function getRetryAfter(): int
    {
        return $this->retryAfter;
    }
}