<?php

namespace n8n;

require_once WD . '/modules/n8n/config/n8n_enabled_c.php';
require_once WD . '/modules/n8n/config/n8n_api_url_c.php';
require_once WD . '/modules/n8n/config/n8n_api_key_c.php';
require_once WD . '/modules/n8n/config/n8n_webhook_base_url_c.php';

use n8n\config\n8n_api_key_c;
use n8n\config\n8n_api_url_c;
use n8n\config\n8n_enabled_c;
use n8n\config\n8n_webhook_base_url_c;
use traits\module_config_t;

class n8n_c
{
    use module_config_t;

    public n8n_enabled_c $enabled;
    public n8n_api_url_c $api_url;
    public n8n_api_key_c $api_key;
    public n8n_webhook_base_url_c $webhook_base_url;

    public function __construct()
    {
        $this->setupConfig('n8n');
        $this->allowUpdate([
            n8n_enabled_c::class,
            n8n_api_url_c::class,
            n8n_api_key_c::class,
            n8n_webhook_base_url_c::class,
        ]);

        $this->enabled = new n8n_enabled_c();
        $this->api_url = new n8n_api_url_c();
        $this->api_key = new n8n_api_key_c();
        $this->webhook_base_url = new n8n_webhook_base_url_c();
    }
}
