<?php

declare(strict_types=1);

namespace PhpWA\Client;

final class DisconnectDecision
{
    /** @var int */ private $code;
    /** @var string */ private $reason;
    /** @var bool */ private $reconnect;
    /** @var bool */ private $credentialResetRequired;

    public function __construct(int $code, string $reason, bool $reconnect, bool $credentialResetRequired)
    {
        $this->code = $code;
        $this->reason = $reason;
        $this->reconnect = $reconnect;
        $this->credentialResetRequired = $credentialResetRequired;
    }

    public function code(): int { return $this->code; }
    public function reason(): string { return $this->reason; }
    public function shouldReconnect(): bool { return $this->reconnect; }
    public function credentialResetRequired(): bool { return $this->credentialResetRequired; }
}
