<?php
if (!defined('ABSPATH')) {
    exit;
}

class VerifactuTransportException extends RuntimeException
{
    private $soapRequest;
    private $soapResponse;
    private $retryable;
    private $faultCode;
    private $faultString;
    private $aeatCode;
    private $httpStatus;

    public function __construct(
        $message,
        $soapRequest = '',
        $soapResponse = '',
        ?Throwable $previous = null,
        $retryable = true,
        $faultCode = '',
        $faultString = '',
        $aeatCode = '',
        $httpStatus = 0
    ) {
        parent::__construct((string) $message, 0, $previous);
        $this->soapRequest = (string) $soapRequest;
        $this->soapResponse = (string) $soapResponse;
        $this->retryable = (bool) $retryable;
        $this->faultCode = (string) $faultCode;
        $this->faultString = (string) $faultString;
        $this->aeatCode = (string) $aeatCode;
        $this->httpStatus = (int) $httpStatus;
    }

    public function getSoapRequest()
    {
        return $this->soapRequest;
    }

    public function getSoapResponse()
    {
        return $this->soapResponse;
    }

    public function isRetryable()
    {
        return $this->retryable;
    }

    public function getFaultCode()
    {
        return $this->faultCode;
    }

    public function getFaultString()
    {
        return $this->faultString;
    }

    public function getAeatCode()
    {
        return $this->aeatCode;
    }

    public function getHttpStatus()
    {
        return $this->httpStatus;
    }
}
