<?php

namespace motorapi;
require_once WD . '/modules/motorapi/config/motorapi_enabled_c.php';
require_once WD . '/modules/motorapi/config/motorapi_secret_key_c.php';
require_once WD . '/modules/motorapi/config/motorapi_daily_limit_c.php';

use motorapi\config\motorapi_daily_limit_c;
use motorapi\config\motorapi_enabled_c;
use motorapi\config\motorapi_secret_key_c;
use traits\module_config_t;

class motorapi_c
{
    use module_config_t;

    /**
     * The status of the motorapi module
     * @var motorapi_enabled_c
     */
    public motorapi_enabled_c $enabled;
    /**
     * The secret key for the motorapi module (API token)
     * @var motorapi_secret_key_c
     */
    public motorapi_secret_key_c $secret_key;
    /**
     * The daily limit for the motorapi module
     * @var motorapi_daily_limit_c
     */
    public motorapi_daily_limit_c $daily_limit;

    public function __construct()
    {
        $this->setupConfig('motorapi');
        $this->allowUpdate([
            motorapi_enabled_c::class,
            motorapi_secret_key_c::class,
            motorapi_daily_limit_c::class
        ]);
        $this->enabled = new motorapi_enabled_c();
        $this->secret_key = new motorapi_secret_key_c();
        $this->daily_limit = new motorapi_daily_limit_c();
    }
}