<?php
/**
 * Request response model.
 *
 * @package flo-checkout
 */

namespace Flo_Checkout\Gateways\Shift4_APM\Requests\Models;

use Flo_Checkout\Gateways\Shift4_APM\Abstract_APM_Gateway;
use Flo_Checkout\Gateways\Shift4_APM\Traits\Gateway_Request_And_Response_Logger_Trait;
use WpOrg\Requests\Utility\CaseInsensitiveDictionary;

defined( 'ABSPATH' ) || exit;

/**
 * Request response model.
 */
readonly class Gateway_Request_Response_Model extends Request_Response_Model {
	use Gateway_Request_And_Response_Logger_Trait;

	/**
	 * Construct class.
	 *
	 * @param Abstract_APM_Gateway            $gateway The gateway instance.
	 * @param string                          $type        Response handler type.
	 * @param string                          $body_string Body.
	 * @param int|string                      $status_code Status code.
	 * @param CaseInsensitiveDictionary|array $headers     Headers.
	 * @param string                          $url         URL. For debugging.
	 * @param string                          $method      Method. For debugging.
	 */
	public function __construct(
		protected Abstract_APM_Gateway $gateway,
		private string $type,
		private string $body_string,
		int|string $status_code,
		CaseInsensitiveDictionary|array $headers,
		private string $url,
		private string $method,
	) {
		parent::__construct(
			$type,
			$body_string,
			$status_code,
			$headers,
			$url,
			$method,
		);
	}
}
