<?php

namespace bird;

require_once WD . '/traits/module_config_t.php';
require_once WD . '/modules/bird/config/bird_enabled_c.php';
require_once WD . '/modules/bird/config/bird_api_key_c.php';
require_once WD . '/modules/bird/config/bird_server_url_c.php';
require_once WD . '/modules/bird/config/bird_workplaceId_c.php';
require_once WD . '/modules/bird/config/bird_channelId_c.php';

use bird\config\bird_enabled_c;
use bird\config\bird_api_key_c;
use bird\config\bird_server_url_c;
use bird\config\bird_workplaceId_c;
use bird\config\bird_channelId_c;
use traits\module_config_t;

class bird_c
{
    use module_config_t;

    /**
     * Whether the Bird module is enabled
     * @var bird_enabled_c
     */
    public bird_enabled_c $enabled;

    /**
     * API key/token for Bird API (secret)
     * @var bird_api_key_c
     */
    public bird_api_key_c $api_key;

    /**
     * Base server URL for Bird API
     * @var bird_server_url_c
     */
    public bird_server_url_c $server_url;

    /**
     * Default Bird workplace identifier
     * @var bird_workplaceId_c
     */
    public bird_workplaceId_c $workplaceId;

    /**
     * Default Bird channel identifier
     * @var bird_channelId_c
     */
    public bird_channelId_c $channelId;

    public function __construct()
    {
        $this->setupConfig('bird');
        $this->allowUpdate([
            bird_enabled_c::class,
            bird_api_key_c::class,
            bird_server_url_c::class,
            bird_workplaceId_c::class,
            bird_channelId_c::class,
        ]);
        $this->enabled = new bird_enabled_c();
        $this->api_key = new bird_api_key_c();
        $this->server_url = new bird_server_url_c();
        $this->workplaceId = new bird_workplaceId_c();
        $this->channelId = new bird_channelId_c();
    }
}
